Electrical device and program update method thereof

ABSTRACT

An electrical device includes a housing, at least one adapter interface to enable one or more battery packs to be detachably mounted to the electrical device, a control module, and a communication module including a wireless communication module and a storage module. The storage module is used for storing an upgrade file from an external device. The upgrade file includes an upgrade program to update the program of the control module. The communication module is configured to receive the upgrade file from the external device through a wireless communication module, store the upgrade file in the storage module, and send the upgrade file to the control module to update the program of the control module if preset conditions are met.

RELATED APPLICATION INFORMATION

The present application claims the benefit of International ApplicationNumber PCT/CN2018/114972, filed on Nov. 12, 2018 and PCT/CN2018/122770,filed on Dec. 21, 2018, which applications claim the benefit of ChinesePatent Application No. 201711237737.5, filed on Nov. 30, 2017 andChinese Patent Application No. 201711392631.2, filed on Dec. 21, 2017 inthe SIPO (State Intellectual Property Office—Chinese Patent Office).Each of these applications is incorporated herein by reference in itsentirety.

FIELD

The present disclosure relates to an electrical device and a programupdate method of the electrical device.

BACKGROUND

With the development of battery technology, power took are graduallyreplacing engine tools. In order to achieve the operation effect andendurance time of the engine work, the rated power and rated capacity ofthe battery pack for powering the power tool is also increasing, and theoutput power requirement of the charging device for charging the batterypack is correspondingly increasing. Therefore, the safety requirementsfor the charging device are also increasing. Similarly, since the powertool uses the motor to work, the output current and output power islarge, which poses certain dangers during operation, and thus requiresgood safety performance.

In addition, AC power is often required to power some tools orfacilities during outdoor work or travel. Traditional portable powersupply devices often obtain power from an internal battery cell group,and once the power of the battery cell group is exhausted, the AC powersupply cannot be continued. The present disclosure solves this problemby using the battery pack that powers the power tool to power theportable power supply device.

When problem occurs in one or more software programs in the chargingdevice, the power tool or the portable power supply device, or when aprogram change or software upgrade is required for the already shippedproduct, the device needs to be disassembled and debugged to implementproduct software changes, which not only requires a lot of manpower andresources, but also delays the project cycle. For this reason, there isan urgent need for a convenient software change or upgrade methodsuitable for an electrical device in the field of power took such as theabove-described charging device, power tool or portable power supplydevice.

In addition, during the program update process, the upgrade filetransmission or the program update may be interrupted due to certainreasons (for example, power failure, network disconnection, etc.),resulting in incomplete upgrade file or updated program. The incompleteand corrupted program can cause the charging device, the power tool andthe portable power supply device to work improperly and bring safetyhazard that leads to safety accidents.

SUMMARY

In order to solve the deficiencies of the prior art, an object of thepresent disclosure is to provide an electrical device along with aprogram update method of the electrical device that makes program updateconvenient, fast, safe and reliable.

In order to achieve this and other objectives, the present disclosureadopts the following technical solutions:

An example electrical device includes: a housing; at least one adapterinterface formed on a surface of the housing to detachably mount one ormore battery packs to the at least one adapter interface, wherein thebattery pack can be used for a hand-held power tool or garden tools; anda control module that programmably controls an operation process of theelectrical device; wherein the electrical device further includes acommunication module, and the communication module includes: a wirelesscommunication module to wirelessly communicate with an external deviceto receive an upgrade file from the external device; a storage module tostore the upgrade file from an external device; the upgrade fileincludes an upgrade program for updating a program of the controlmodule; the communication module is configured to receive the upgradefile from an external device through the wireless communication module,store the upgrade file in the storage module, and if preset conditionsare met, send the upgrade file to the control module to update theprogram of the control module.

In a further example, the preset conditions include the communicationmodule receiving an upgrade request from the control module.

In a further example, the upgrade file has a program end flag and thecontrol module sends the upgrade request to the communication modulewhen the program end flag is not received.

In a further example, the preset conditions include the communicationmodule receiving an upgrade request from an external device.

In a further example, the electrical device is a portable power supplydevice, the portable power supply device further includes an invertermodule, the inverter module includes an inverter, and the inverter isused for converting the direct current outputted by the battery packinto alternating current; the inverter module is electrically connectedto the control module, and is at least partially under the control ofthe control module.

In a further example, the electrical device further includes a data bus,the control module and the inverter module being connected to thecommunication module via the data bus; the communication module isconfigured to receive the upgrade file of the external device throughthe wireless communication module and store it in the storage module;and transmit the upgrade file to the control module and/or the invertermodule through the data bus; the upgrade file includes an upgradeprogram that updates the program of the control module and/or theinverter module.

In a further example, the control module and the inverter module haveunique identifiers.

In a further example, the upgrade file includes a unique identifier ofthe control module and/or the inverter module.

In a further example, the wireless communication module includes a WIFImodule and/or a Bluetooth module.

In a further example, the control module includes a storage module, thestorage module storing a first partial program and a second partialprogram, the first partial program being executable by the controlmodule to update the second partial program.

In a further example, the electrical device is a battery pack or a powertool that supplies power using the battery pack or a charging devicethat charges the battery pack.

A program update method compatible with the electrical device,including: the communication module receives an upgrade file from theexternal device through the wireless communication module and stores theupgrade file in the storage module; the communication module sends theupgrade file to the control module when preset conditions are met; thecontrol module updates its own program according to the upgrade file.

In a further example, the communication module transmits the upgradefile to the control module when the communication module receives anupgrade request from the control module.

In a further example, the upgrade file has a program end flag, and thecontrol module sends the upgrade request to the communication modulewhen the program end flag is not received.

In a further example, the communication module transmits the upgradefile to the control module when the communication module receives anupgrade request from an external device.

Another program update method compatible with the electrical device,includes: the communication module receives an upgrade file from anexternal device through the wireless communication module and stores theupgrade file in the storage module; the communication module sends anupgrade instruction to the data bus when preset conditions are met;after receiving the upgrade instruction from the data bus, the controlmodule and the inverter module stop working and enter a listening state;the control module and the inverter module determine whether the upgradeinstruction is an upgrade instruction to itself, and if yes, enter anupgrade mode, and if not, continue to maintain the listening state;after one of the control module and the inverter module determines thatthe upgrade instruction is an upgrade instruction to itself, sends theupgrade instruction to the data bus; after receiving the upgraderesponse from the data bus, the communication module sends the upgradefile through the data bus to the control module or the inverter modulethat sends the upgrade response; the control module or the invertermodule updates its own program according to the upgrade file afterreceiving the upgrade file.

In a further example, when the communication module receives an upgraderequest from the control module or the inverter module, thecommunication module sends an upgrade instruction to the data bus.

In a further example, the upgrade file has a program end flag, and thecontrol module or the inverter module sends the upgrade request to thecommunication module when the program end flag is not received.

In a further example, the communication module transmits an upgradeinstruction to the data bus when the communication module receives anupgrade request from an external device.

In a further example, the control module and the inverter module haveunique identifiers, and the upgrade instruction includes the uniqueidentifier of the control module and/or the inverter module; The controlmodule and the inverter module determine whether the unique identifierin the upgrade instruction matches its own unique identifier, and if so,determine that it is an upgrade instruction for itself.

In a further example, the control module and the inverter module haveunique identifiers, and the upgrade response includes the uniqueidentifier.

In a further example, the program update method further includes: afterreceiving the upgrade response, the communication module sends anupgrade key to the control module or the inverter module that matchesthe unique identifier in the upgrade response; after the control moduleor the inverter module that matches the unique identifier receives theupgrade the key, enters the program update process.

In a further example, the communication module transmits the upgradefile to the control module and the inverter module in a preset order.

In a further example, the program update method further includes: afterthe program update of itself is completed, the control module or theinverter module sends an upgrade end feedback to the communicationmodule; When the communication module does not receive the upgrade endfeedback from the control module and the inverter module, thecommunication module sends an upgrade instruction to the data bus.

A benefit of the present disclosure is that: the electronic device andthe program update method do not require disassembling andreinstallation for program update, saving manpower and materialresources, being convenient, fast, safe and reliable.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a structural diagram of a battery pack, according to anexample;

FIG. 2 is a schematic circuit diagram of a battery pack, according to anexample;

FIG. 3 is a second communication circuit of the battery pack in theexample shown in FIG. 2;

FIG. 4 is a structural diagram of a battery pack and the electricaldevice in a first example;

FIG. 5 is a structural diagram of a battery pack and an electricaldevice in a second example;

FIG. 6 is a structural diagram of a battery pack and an electricaldevice in a third example;

FIG. 7 is a schematic diagram depicting the connection of an electricaldevice, a battery pack, and a power tool in the third example;

FIG. 8 is an information exchange network diagram between an electricaldevice and an external device according to the third example;

FIGS. 9-11 are user mobile phone application interfaces wirelesslyconnected to the electrical device of the third example;

FIG. 12 is a schematic diagram of the memory partitioning of a flashmemory;

FIG. 13 is an information exchange process between the communicationdevice and the node in the upgrade mode;

FIG. 14 is a work flow chart of the communication device in FIG. 13;

FIG. 15 is a work flow chart of the node in FIG. 13;

FIG. 16 is a specific wiring diagram of the communication device, themain control module and the inverter module;

FIG. 17 is a work flow chart of the firmware upgrade of the main controlmodule and the inverter module by the communication device;

FIG. 18 is a schematic diagram of the internal structure of the upgradedevice and the power tool;

FIG. 19 is the information exchange process between the upgrade deviceand the power tool shown in FIG. 18 in the upgrade mode;

FIG. 20 is a schematic diagram of the internal structure of the upgradedevice and the battery pack;

FIG. 21 is the information exchange process between the upgrade deviceand the battery pack shown in FIG. 20 in the upgrade mode;

FIG. 22 is a schematic diagram of the timeout retransmission mechanism.

DETAILED DESCRIPTION

The disclosure will be further described in detail below with referenceto the drawings and examples. It can be understood that the specificexamples described herein are only used to explain the presentdisclosure, rather than to limit the present disclosure. In addition, itshould be noted that, for the ease of description, the drawings onlyshow the parts related to the present disclosure, but not allstructures.

Referring to FIG. 1, an example of a battery pack 200 mainly includes: ahousing 210; a battery cell group 220 accommodated in the housing 210,the battery cell group 220 including a plurality of battery cells 221;and a plurality of battery pack connection terminals 230 used to coupleto the connection terminals of an electrical device connected to thebattery pack 200;

The battery cell group 220 is accommodated in the housing 210, andincludes more than one series module. When the number of series modulesis greater than or equal to 2, different series modules are connected inseries and the whole of them constitutes the battery cell group 220. Aseries module includes more than one battery cells 221. When the numberof battery cells 221 in the same series module is greater than 2,different cells 221 are connected in parallel to form a series module.The battery cells 221 are used to store energy, which can be repeatedlycharged and discharged. The battery cells 221 are electrically connectedthrough cell interconnects 222.

The plurality of battery pack connection terminals 230 include a batterypack positive power terminal 233 and a battery pack negative powerterminal 234. The battery pack positive power terminal 233 iselectrically connected to the negative pole of the battery cell group220, and the battery pack negative power terminal 234 is electricallyconnected to the positive pole of the battery cell group 220. In thepresent example, the plurality of battery pack connection terminals 230further includes a first battery pack terminal 231 and a second batterypack terminal 232, wherein the first battery pack terminal 231 is usedto transmit the first type of data, and the second battery pack terminal232 is used to transmit the second type of data. The first type of datais data for normal operation, and the second type of data is data fordata analysis. In this way, the battery pack 200 can not only transmitdata during normal operation but also transmit data for data analysis,ensuring normal operation and data collection.

In other examples, the first battery pack terminal may also be used totransmit the first type of data and the second type of data, and thesecond battery pack terminal may be used to transmit the first type ofdata and the second of type of data.

Since the first type of data is data for normal work, the second type ofdata is data for data analysis, the second type of data has a largeramount of data than the first type of data. In an example, at least oneof the first battery pack terminal 231 and the first connection terminalhas a first data transmission rate, and at least one of the secondbattery pack terminal 232 and the second connection terminal has asecond transmission rate higher than the first the first datatransmission rate. The advantage of this is that the transmission rateof transmitting the second type of data is higher than the transmissionrate of the first type of data. Distinguishing the transmitting rate fordifferent types of data ensures that the two types of data can beefficiently transmitted without increasing cost.

The strong anti-interference performance of low-speed communicationbenefits when work in a strong interference electromagnetic environmentsuch as motor control, while the anti-interference performance of thehigh-speed communication is weaker than the low-speed communication, butthe data transmission capability of the high-speed communication isstrong. Therefore, in an example, the first connection terminal or thefirst battery pack terminal of the first data transmission rate may beprovided only in one of the battery pack and the electrical device wherethe electromagnetic interference is strong, and the second connectionterminal or the second battery pack terminal of the second datatransmission rate may be provided only in one of the battery pack andthe electrical device where the electromagnetic interference is weak.Hereby, the effect of strong electromagnetic influence on the datatransmission reliability can be avoided.

Referring to FIG. 2, the normal operation of the battery pack 200 alsorelies on circuit components. The circuit components mainly include abattery pack controller 241, a temperature sensor 242, a firstcommunication circuit 243, a second communication circuit 244, and avoltage detecting circuit 245.

The battery pack controller 241 is mainly used to implement functionssuch as logic operation and process control, and can control variouscircuit components in the battery pack 200 to ensure the safety of thebattery pack 200 during charging and discharging. The battery packcontroller 241 may be a chip having a control function such as a singlechip microcomputer.

The temperature sensor 242 is used for detecting the internaltemperature of the battery pack 100. The temperature sensor 242 isconnected to the second communication circuit 243, and the secondcommunication circuit 243 is connected to the second battery packterminal 232, so that the temperature sensor 242 can be electricallyconnected to the second battery pack terminal 232, thereby, theelectrical device connected to the battery pack 200 is capable ofobtaining the temperature of the battery pack 200 by connecting to thesecond battery pack terminal 232, which is used for transmitting thetemperature of the battery pack.

The temperature sensor 242 is disposed inside the battery pack 200.Specifically, the temperature sensor 242 is disposed in the battery pack200 at a position close to the battery cell 221 so that it can detect achange in the temperature of the battery cell 221. In an example, thetemperature sensor 242 may employ a thermistor, especially an NTCthermistor.

Alternatively, the temperature sensor 242 may be electrically coupled tothe battery pack controller 241 to feed back the detection result of thetemperature sensor 242 to the battery pack controller 241 and iscontrolled by the battery pack controller 241.

In other examples, the battery pack 200 includes a battery packidentification resistor (not shown) for characterizing the properties ofthe battery pack, such as the voltage of the battery pack or thechemistry of the battery, the battery pack identification resistor andthe second communication circuits 244 are electrically connected suchthat the battery pack identification resistor can be electricallyconnected to the second battery pack terminal 232, so that theelectrical device connected to the battery pack 200 can obtain theproperties of the battery pack 200 through the connection with thesecond battery pack terminal 232. At this time, the second battery packterminal 232 is used to transmit the properties of the battery pack 200.When the battery pack is mounted to the electrical device, theelectrical device can measure the voltage of the identification resistorthrough the connection with the second battery pack terminal 232,thereby obtaining the resistance value of the identification resistoraccording to the voltage, thereby acquiring the properties of thebattery pack 200.

The first communication circuit 243 is electrically coupled to thebattery pack controller 241 to realize data exchange or signal exchange.The first communication circuit 243 can implement data transmission byhardware connection or wireless connection. Since the battery pack 100has a high voltage and output power, when it is connected to anelectrical device such as a charger, a power tool, or a portable powersupply device, high connection reliability is required. In an example,the first communication circuit 243 implements data transmission bymeans of hardware connection. The first communication circuit 243 isconnected to the first battery pack terminal 231 for data transmission.When the battery pack 200 is mounted to an external electrical device,the first battery pack terminal 231 can be physically connected to acorresponding terminal of the external electrical device.

The second communication circuit 244 is electrically coupled to thetemperature sensor 242 to convert the signal of the temperature sensor242 into an electrical signal recognizable by an external electricaldevice connected to the battery pack 200. The second communicationcircuit 244 is also electrically coupled to the battery pack controller241 and is controlled by the battery pack controller 241.

Optionally, the battery pack 200 may further includes a voltagedetecting circuit 245 for detecting voltage values of respective seriesmodules 111 in the battery cell group 220, and the voltage detectingcircuit 245 is electrically connected to the battery cell group 220 andthe battery pack controller 241, respectively.

The voltage detecting circuit 245 detects the voltage signals in thebattery cell group 220 and transmits the voltage signals to the batterypack controller 241. The battery pack controller 241 calculates voltagevalues according to the voltage signals transmitted by the voltagedetecting circuit 245 to implement voltage safety monitoring the batterypack 100.

In some examples, the battery pack 200 further includes a battery packmemory 246 to store data of the battery pack, as well as data of theelectrical device connected to the battery pack 200. Specifically, whenthe battery pack 200 is assembled to an electrical device such as thecharger 400, the power tool 300, the portable power supply device 100,the data of the electrical device is acquired through the connection ofthe second battery pack terminal 232 to the connection terminal of theelectrical device, and stored on the battery pack memory 246. Thebattery pack memory 246 stores the data as a second type of data fordata analysis.

In some examples, the battery pack 200 further includes a battery packpower display module (not shown in FIG. 2) electrically connected to thebattery pack controller 241, and the battery pack power display moduleis configured to display the remaining amount of power in the batterypack 200.

The electrical device capable of being connected to the battery pack 200includes a positive power connection terminal, a negative powerconnection terminal, a first connection terminal, and a secondconnection terminal, wherein the positive power connection terminal andthe negative power source connection terminal are respectively connectedto the battery pack positive power terminal 233 and the battery packnegative power terminal 234 to transmit electrical energy. The firstconnection terminal is connected to the first battery pack terminal 231to transmit the first type of data; and the second connection terminalis connected to the second battery pack terminal 232 to transmit thesecond type of data.

The battery pack 200 can be mounted to an electrical device. When thebattery pack 200 is mounted to the electrical device, the positive powerconnection terminal is connected to the battery pack positive powerterminal 233, and the negative power connection terminal is connected tothe battery pack negative power terminal 234. The first connectionterminal is connected to the first battery pack terminal 231, and thesecond connection terminal is connected to the second battery packterminal 232.

The battery pack 200 has a normal operation mode and a data transmissionmode. In the normal operation mode, the first battery pack terminal 231transmits the first type of data for the normal operation of the batterypack 232 and/or the electrical device connected to the battery pack 200.In the data transmission mode, the second battery pack terminal 232transmits the second type of data for data analysis of the battery pack200 and/or the electrical device connected to the battery pack 200.

In order to switch the battery pack 200 between the normal operationmode and the data transmission mode, the battery pack controller 241 isfurther configured to control the battery pack 200 to switch between thenormal operation mode and the data transmission mode.

In order to switch between the normal operation mode and the datatransmission mode of the battery pack 200, the second communicationcircuit 244 further includes at least one switching element electricallyconnected to the temperature sensor 242 to turn on or turn off theelectrical connection between the temperature sensor 242 and the secondbattery pack terminal 232. The controller 241 is configured to controlan on-off state of the switching element to switch the battery pack 200to the normal operation mode or the data transmission mode. Theswitching element may be a semiconductor switch (e.g., a triode, a fieldeffect transistor), or may be another switch having a control terminalconnected to the battery pack controller 241. Of course, in otherexamples, the temperature sensor 242 may also be replaced with anidentification resistor.

Referring to FIG. 3, in an example of the second communication circuit244, RT is a temperature sensor 242 for detecting the temperature of thebattery pack 200, specifically, an NTC thermistor RT. One end of thethermistor RT is connected to the second battery pack terminal 232 ofthe battery pack 200, and the other end of the thermistor RT isconnected to one end of the transistor Q1. The control end of thetransistor Q1 is connected to the control signal output terminal PIN_NTCof the battery pack controller 241 through resistor Dl. The other end ofthe transistor Q1 is grounded.

The second communication circuit 244 also includes a transistor Q3 tocontrol the battery pack 200 to be in a receiving state or atransmitting state.

In the normal operation mode, the battery pack controller 241 sets thecontrol signal output terminal PIN_NTC high, turns the transistor Q1 onand the transistor Q3 off, and the thermistor RT connects the secondcommunication circuit 244 to collect the temperature of the battery pack200. The second battery pack terminal 232 transmits the temperature ofthe battery pack, and the first battery pack terminal 231 transmits thefirst type of data for normal operation, such as the charging current ordischarging current during charging or discharging of the battery pack,single cell voltage, cell group voltage. The first battery pack terminal231 may also transmit data of the electrical device connected to thebattery pack, the data being related to a specific electrical device.The first type of data is used to maintain the normal operation of theelectrical device and the battery pack 200 and protect the battery pack200 and the electrical device.

The advantage is that the second battery pack terminal 232 can not onlytransmit the second type of data for data analysis of the electricaldevice and the battery pack 200, but also can be used to transmit thetemperature and properties of the battery pack 200. Realizing twofunctions with one terminal reduces the number of terminals used,reduces cost, and can be used for data transmission while ensuringnormal operation with a low cost.

In an example, once the normal operation mode ends, that is, once thebattery pack 200 stops charging or discharging, the battery pack 200switches to the data transmission mode. Specifically, the battery packcontroller 241 controls the switching element to switch the battery pack200 to the data transmission mode.

The advantage is that the battery pack 200 only switches to the datatransmission mode after the normal operation mode ends, that is, afterthe battery pack 200 stops charging or discharging, can avoid thesituation of switching to the data transmission mode suddenly when thenormal operation mode has not ended, which may cause system disorderthat affects the normal operation of the battery pack 200 and theelectrical device and damages the battery pack and the electricaldevice, and the reliability of the transmitted data. In addition,comparing with switching to the data transmission mode before the normaloperation mode, switching to the data transmission mode after the normaloperation mode can send the second type of data of the battery pack 200and the electrical device in time through the wireless communicationmodule, avoiding long time occupation.

Specifically, the battery pack controller 241 sets the control signaloutput terminal PCB_NTC low to turn on Q3 and turn off Q1, no currentpasses through the thermistor RT, and the thermistor RT is disconnectedfrom the second battery pack terminal 232. Thus, the battery pack 200can transmit data to the electrical device through the data transmittingend BT_TX, and receive data of the electrical device from the datareceiving end BT_RX. The controller of the battery pack 200 initializesthe BT_RX and BT_TX terminals to be serial port, so that the secondbattery pack terminal 232 becomes a two-way serial port.

At this time, the second battery pack terminal 232 is used to transmitthe second type of data for data analysis. For example, the battery pack200 may send the current State of Charge (SOC) and State of Health (SOH)data of the battery pack 200 to the electrical device through the secondbattery pack terminal 232, as well as history data and/or statisticaldata stored in battery pack memory 246, including the fault information,the number of uses, the maximum voltage/current, the current actualcapacity of the battery pack 200, and/or the second type of data ofother electrical devices collected by the battery pack 200. The batterypack 200 may also receive the second type of data of the electricaldevice through the second battery pack terminal 232, including thecurrent state data of the electrical device and/or history data and/orstatistical data stored in the memory of the electrical device.

The battery pack of the present disclosure has two modes, a normaloperation mode and a data transmission mode. Through the two terminals(the first battery pack terminal 231 and the second battery packterminal 232), the first type of data is transmitted in the normaloperation mode and the second type of data is transmitted in the datatransmission mode. Data collection can be performed while ensuringnormal operation.

In an example, the battery pack 200 or the electrical device includes awireless communication module, and the wireless communication module isconfigured to establish a wireless communication connection between thebattery pack or the electrical device and the external device. Throughthe wireless communication module, the battery pack or the electricaldevice can transmit the collected second type of data to the externaldevice. The external device includes a communication device, and thecommunication device includes a wireless communication module havingdata processing and analysis functions.

Thus, the second type of data of the battery pack and the second type ofdata of the electrical device collected through the second battery packterminal 232 by the battery pack 200 can be transmitted to the externaldevice through the wireless communication module disposed on the batterypack 200. Or, the second type of data of the electrical device and thesecond type of data of the battery pack 200 collected through the secondbattery pack terminal 232 by the electrical device can be transmitted tothe external device through a wireless communication module disposed onthe electrical device. The external device has data processing and theanalysis function, so that the external device can provide data supportfor research and development of the battery pack and the electricaldevice after processing and analysis of the second type of data, andalso facilitate the maintenance staff to diagnose and repair the batterypack 200 and the electrical device, saving manpower and materialresources.

The wireless communication module can act as a wireless router of alocal area network, which can directly access the Internet or cancommunicate with a wireless communication device capable of accessingthe Internet to enable other wireless communication devices in the localarea network to access the Internet. Of course, the wirelesscommunication module may alternatively only realize data interaction forthe wireless communication devices within the local area network. Thewireless communication device may realize wireless communication byusing Bluetooth, WiFi, NFC, ZigBee, and the like.

The external device may include a remote server having data processingand analysis functions, the remote server including a wirelesscommunication module. Data transmits between the battery pack 200 or theelectrical device and the remote server through respective wirelesscommunication modules. Of course, the external device can also transmitdata to the portable power supply device 100 through the wirelesscommunication module.

The external device may further include a mobile terminal device (forexample, a mobile phone) with data transmitting and receiving functions;the mobile terminal device includes a wireless communication module, andthe mobile terminal device, the remote server, or the electrical devicetransmits data through respective wireless communication modules.Hereby, the mobile terminal device can send an instruction or data tothe electrical device through the wireless communication module, and canalso receive data of the electrical device or the battery pack 200. Themobile terminal device includes a display module capable of displayingthe information sent by the battery pack 200 or the electrical device,including the current status information of the electrical device orbattery pack, such as the remaining battery capacity of the batterypack, the remaining available time, etc. The display interface makes itconvenient for the user to check and to determine whether to charge ordischarge the battery pack, and whether to end the work in progress tosave electric power.

In this way, the battery pack 200 or the electrical device can transmitthe collected second type of data for data analysis to the remote serverthrough the wireless communication module for data processing andanalysis, provide support for research and development, fault diagnosis;or transmit the collected second type of data to the mobile terminaldevice for the convenience of the user to check the status of theelectrical device or the battery pack to arrange the next work. Forexample, whether the number of failures of the electrical device hasreached the upper limit that needs to repair, and whether thetemperature of the battery pack 200 has reached the upper limit thatneeds to suspend.

Of course, the wireless communication method of the wirelesscommunication module can also be replaced by a wired communicationmethod. However, considering the complexity of the battery pack and theelectrical device operating conditions and the limitation of theenvironment, the wireless communication mode of the wirelesscommunication module is used to send the collected data to externaldevices, which makes the operation more convenient and saves manpowerand material resources.

Following the above approach, by providing the second battery packterminal 232 and the corresponding second connection terminal of theelectrical device, the battery pack 200 or the electrical device can beused to collect the second type of data for data analysis of the batterypack and the electrical device. There is no need to separately collectthe second type of data for data analysis of the electrical device andthe battery pack 200 by using other devices, thereby ensuring theoperation of the electrical device and the battery pack 200, andsimultaneously realizing data collection, saving additional datacollection equipment. In addition, switching to data transmission modeonce normal operation mode ends makes data collection more automatic andconvenient. Compared with the traditional data separately collected forthe battery packs 200 and electrical devices, the data of the batterypack and the electrical device collected by the electrical device or thebattery pack 200 is more concentrated, which can facilitate subsequentdata processing and analysis work, such as data deduplication and dataclassification, saving manpower, material and time.

In an example, the external device is a remote server. In order tofacilitate the analysis and processing of the data received by theremote server 20, the second type of data of the electrical device or ofthe electrical device collected by the battery pack 200 and of thebattery pack 200 are categorized into three types of data: real-timedata, statistical data, and history data. The data is respectivelystored in specified memory partitions of the battery pack 200 or theelectrical device according to different types of history data,statistical data, and real-time data. When the specified memorypartition is used up, the original data will be overwritten by thecurrent data. This scrolling storage method saves the latest data andsaves the storage space.

In order to distinguish data of different devices (battery packs andelectrical devices), device identity information may be added orassociated with the above three types of data in order to track the fulllife cycle state of the product. In some examples, the device identityinformation is a unique identifier. In the above approach, theelectrical device and the battery pack have unique identifiers, and thesecond type of data includes a unique identifier. The electrical devicemay be a portable power supply device 100, a power tool 300 and acharger 400.

Since the data is divided into real-time data, statistical data, andhistory data with time attributes, it is necessary to add or associatetime information to the above data. In other words, at least one of theabove three types of data, real-time data, statistical data, and historydata contains time information, and such data with time information isnecessary for big data analysis later. Due to the inconsistency of timein various regions and countries of the world, in order to ensure thetime synchronization or time consistency for data in various regions,the time in the data is measured in UTC. The battery pack 200 or theelectrical device having the wireless communication module acquires theworld standard time from an external device having world standard timeinformation, and the battery pack or the electrical device calibratesits own time information using the acquired world standard time, whenthe electrical device or the battery pack 200 is connected to thebattery pack 200 or the electrical device, the battery pack 200 or theelectrical device transmits the acquired world standard time calibrationto the electrical device or the battery pack 200 through the connectionterminal. The method passes the standard time step by step. According tothe above, the data generated or transmitted by the battery pack 200 andthe electronic device can maintain the time synchronization or timeconsistency in various regions of the world, which is convenient forunified management.

As a result of the above approach, the second type of data sent by theelectronic device or the battery pack 200 to the remote server throughthe wireless communication module may appear or be associated with thesame time and the same unique identifier, resulting in data duplication.In order to reduce the amount of data stored and facilitate datasorting, in an example, a deduplication function can be introduced inthe remote server, that is, a function that distinguishes the order ofdata according to its time to remove redundant data with the same timeand the same unique identifier, so as to avoid data duplication andconflicts.

In order to minimize the size of the battery pack, in the presentexample, the battery pack 200 does not include a wireless communicationmodule.

It should be contemplated that, when the current electrical device doesnot have a wireless communication module, the second type of data of thebattery pack 200, the second type of data stored in the battery packmemory 246 of other electronic devices that once connected to thebattery pack 200, and the second type of data of the electronic devicecannot be transmitted to the external device through the wirelesscommunication module of the electrical device. In this case, if thebattery pack 200 still transmits the second type of data of the batterypack 200 and/or the second type of data stored in the battery packmemory 246 of other electronic devices that once connected to thebattery pack 200 to the electrical device, then not only the second typeof data of the battery pack 200 cannot be transmitted to the externaldevice through the electrical device, but also the memory space of theelectrical device will be also occupied. In order to solve this problem,the battery pack 200 transmits the second type of data to the electricaldevice only when the electrical device has a wireless communicationmodule.

In order to distinguish whether the electrical device has a wirelesscommunication module, the electrical device has identity information,and the identity information includes whether the electrical device hasa wireless communication module, and the wireless communication moduleis used to establish a wireless communication connection between theelectrical device and the external device, and the electrical device cantransmit the second type of data to the external device through thewireless communication module.

In some specific examples, the identity information may be a serialnumber stored in a memory of the electrical device, and the memory isfurther capable of storing the second type of data of the battery pack200 used for data analysis and the second type of data of the electricaldevice used for data analysis.

The serial number is the device model of the electrical device, and thebattery pack 200 can read the serial number through the first batterypack terminal 231 to determine whether the electrical device has awireless communication module; in other specific examples, theresistance value of an identification resistor can be used to representthe identity information of the electronic device. The battery pack 200can measure the voltage of the identification resistor through the firstbattery pack terminal 231 and obtain the resistance value of theidentification resistor from the voltage, thereby determine whether theelectrical device has a wireless communication module.

When the battery pack 200 is connected to the electrical device, thefirst battery pack terminal 231 is further configured to acquire theidentity information of the electrical device. This has the advantagethat the first battery pack terminal 231 can not only transmit the firsttype of data for the normal operation of the electrical device and thebattery pack 200, but also can detect whether the electrical device hasa wireless communication module. Realizing two functions with oneterminal reduces the number of terminals used, reduces cost, and can beused for data transmission while ensuring normal operation with a lowcost.

The battery pack controller 241 is configured to: determine whether theelectrical device has a wireless communication module based on theidentity information of the electrical device obtained by the firstbattery pack terminal 231; and after determining that the electricaldevice has the wireless communication module, control the switchingelements (Q1 and Q3 in FIG. 3) of the second communication circuit 244to disconnect the electrical connection between the temperature sensor242 or the identification resistor in the battery pack 200 and thesecond battery pack terminal 232 to cause the second battery packterminal 232 to transmit the second type of data used for data analysis.

According to the above approach, after the normal operation mode ends,that is, after the battery pack 200 ends charging or discharging, thebattery pack 200 acquires the identity information of the electricaldevice through the first battery pack terminal 231, and the battery packcontroller 241 determines whether the electrical device has a wirelesscommunication module. If yes, the battery pack 200 transmits the secondtype of data for data analysis through the second battery pack terminal232. If not, the battery does not transmit the second type of data usedfor data analysis through the second battery pack terminal 232 after thenormal operation mode ends.

In this way, after the normal operation mode ends, if the electricaldevice has a wireless communication module, the second type of data ofthe electrical device and the battery pack can be sent to the externaldevice through the wireless communication module promptly to avoidoccupying the memory of the electrical device and the battery pack for along time.

The present disclosure also provides a data transmission method of theabove battery pack 200 and the electrical device. As described above,the battery pack 200 has a normal operation mode and a data transmissionmode, and the battery pack 200 includes a first battery pack terminal231 and a second battery pack terminal 232. The electrical deviceincludes a first connection terminal and a second connection terminal,the first connection terminal being used for connecting to the firstbattery pack terminal 231, and the second connection terminal being usedfor connecting to the second battery pack terminal 232. The datatransmission method includes:

In the normal operation mode, the battery pack 200 and the electricaldevice transmit the first type of data through the first battery packterminal 231 and the first connection terminal;

In the data transmission mode, the battery pack 200 and the electricaldevice transmit the second type of data through the second battery packterminal 232 and the second connection terminal.

In an example, at the initial stage in which the battery pack 200 getsconnected to the electrical device, the battery pack 200 operates in anormal operation mode, and after the normal operation mode ends, thebattery pack 200 switches to the data transmission mode.

In another example, at the initial stage in which the battery pack 200gets connected to the electrical device, the battery pack 200 operatesin a normal operation mode; and after the normal operation mode ends,the battery pack 200 checks whether the electrical device has a wirelesscommunication module based on the identity information of the electricaldevice, and only when it is determined that the electrical device has awireless communication module will the battery pack 200 switch to thedata transmission mode.

One of the battery pack 200 and the electrical device has a wirelesscommunication module for establishing a wireless communicationconnection with an external device. One of the battery pack 200 and theelectrical device can transmit the second type of data of the batterypack 200 and the electrical device through the wireless communicationmodule to the external device.

The electrical device and battery pack 200 have a unique identifier, thesecond type of data includes the unique identifier; the second type ofdata further includes the same time information, and the external deviceis configured to delete the data with the same time and the same uniqueidentifier.

The first type of data is data for normal operation of the battery pack200 and/or the electrical device, and the second type of data is datafor data analysis of the battery pack 200 and/or the electrical device.

In an example, at least one of the first battery pack terminal 231 andthe first connection terminal has a first data transmission rate, and atleast one of the second battery pack terminal 232 and the secondconnection terminal has a second data transmission rate higher than thefirst data transmission rate.

In the present disclosure, the first type of data contains current statedata of the battery pack and/or current operating condition data of theelectrical device; the second type of data contains at least one ofcurrent state data, historical state data, and usage data of the batterypack, and/or at least one of current operating condition data,historical operating condition data, and usage data of the electricaldevice.

The following illustrates the solution of the present disclosure bytaking several different electrical devices as examples.

Referring to FIG. 4, in a first example, the electrical device is apower tool 300. The power tool 300 includes a main body 310 and a tooladapter interface 320. The tool adapter interface 320 is used to mountthe battery pack 200 as described above.

The main body 310 includes a motor (not shown), a housing 311, and atool member 330 for realizing a tool function, wherein the motor isdisposed in the tool housing 311, and the tool member 330 is mounted ata front end of the tool body.

The tool adapter interface 320 is provided with a plurality of toolconnection terminals for establishing electrical energy or/and signaltransmission with the battery pack 200. The plurality of tool connectionterminals include: a tool positive power terminal 343 and a toolnegative power terminal 344, which are used to connect to the batterypack positive power terminal 233 and the battery pack negative powerterminal 234 for transmitting electrical energy; a first tool terminal341 for connecting to the first battery pack terminal 231 to transmitthe first type of data; and a second tool terminal 342 for connecting tothe second battery pack terminal 232 to transmit the second type ofdata.

Wherein, the first type of data includes data of the battery pack 200such as voltage, discharge current, and battery cell voltage and/or dataof the current operating state parameters of the power tool 300, such asload current to realize the normal operation and protection of thebattery pack 200 and the power tool 300. The second type of data may bethe operating parameters of the power tool 300, such as the usagefrequency, the failure number, voltage, current, temperature, speed andtorque of the power tool 300. The second type of data may alternativelybe the data of the battery pack 200, such as SOC data and SOH datarelated to the current operating state of the battery pack, and historydata or statistical data stored in the battery pack memory 246.

The power tool 300 also has a normal operation mode and a datatransmission mode; in the normal operation mode, the battery pack 200supplies power to the power tool through the tool connection terminalsand the battery pack connection terminals, and the power tool 300 andthe battery pack 200 transmit the first type of data for the normaloperation of the battery pack 200 and the power tool 300 through thefirst tool terminal 341 and the first battery pack terminal 231; in thedata transmission mode, the power tool 300 and the battery pack 200transmit the second type of data for data analysis through the secondtool terminal 342 and the second battery pack terminal 232.

The power tool 300 has identity information including whether the powertool 300 has a wireless communication module. After the normal operationmode ends, the first tool terminal 341 acquires the identity informationof the power tool 300 through the first battery pack terminal 231.

In an example, the power tool 300 does not have a wireless communicationmodule 350. After the normal operation mode ends, the first toolterminal 341 determines that the power tool 300 does not have a wirelesscommunication module by the identity information of the power tool 300acquired through the first battery pack terminal 231. Therefore, thebattery pack controller 241 does not control the switching element tochange the on-off state, the battery pack 200 and the power tool 300cannot transmit the second type of data through the second battery packterminal 232, and the battery pack 200 and the power tool 300 end thework.

In an example, the power tool 300 has a wireless communication module350, and the first tool terminal 341 determines that the power tool 300has a wireless communication module 350 by the identity information ofthe power tool 300 acquired through the first battery pack terminal 231.Therefore, the battery pack controller 241 controls the switchingelement to change the on-off state to switch the battery pack 200 to thedata transmission mode, and the battery pack 200 can transmit the secondtype of data to the power tool through the second battery pack terminal232. After the data transmission mode ends, the battery pack 200 and thepower tool 300 end the work.

In other examples, considering that the battery pack 200 can also bemounted to other electrical devices such as the charger 400 and theportable power supply device 100 while the power tool 300 can only beused with the battery pack 200, when the power tool 300 does not have awireless communication module, the power tool 300 can still transmit thesecond type of data of the power tool 300 through the second batterypack terminal 232. In the above manner, after the normal operation modeends, the battery pack controller 241 of the battery pack 200 controlsthe switching element to change the conduction state, causing thebattery pack 200 to switch to the data transmission mode. In this way,the battery pack 200 can collect not only its own data but also the dataof the power tool 300. The data collection is more convenient, and thedata of the power tool 300 and the battery pack 200 needs not beseparately collected by other devices. Also, whether the power tool hasa wireless communication module needs not to be worried in order todetermine whether to transmit the second type of data. The datacollection of the power tool 300 can also be realized while the powertool 300 needs not to provide a wireless communication module.

The battery pack 200 stores the second type of data acquired from thepower tool 300 in the battery pack memory 246. Thus, when the batterypack 200 is mounted to the charger 400 or the portable power supplydevice 100, the second type of data of the battery pack 200 and thesecond type of data of the power tool 300 stored in the battery packmemory 246 can be transmitted through the second battery pack terminal232 to the charger 400 or the portable power supply device 100 having awireless communication module. Hereby, a wireless communication modulemay be provided only on the charger 400 or the portable power supplydevice 100, and the data of the charger 400 or the portable power supplydevice 100, the battery pack 200, and the power tool 300 can betransmitted to the external device through the wireless communicationmodule, providing data support for research and development of thecharger 400, the portable power supply device 100, the battery pack 200,and the power tool 300, and facilitating maintenance staff to performfault diagnosis and fault repair, thereby saving manpower and materialresources.

Referring to FIG. 5, in a second example, the electrical device is acharger 400, and the charger 400 includes a housing 410 and a chargeradapter interface 420, and the charger adapter interface 420 is used forinstalling the battery pack 200. The charger adapter interface 420 is atleast partially formed by the housing 410.

The charger 400 also includes a power conversion circuit (not shown inFIG. 5) for converting the incoming alternating current into a directcurrent capable of charging the battery pack 200. A power conversioncircuit is disposed in the housing 410.

The charger adapter interface 420 is provided with a plurality ofcharger connection terminals for establishing power or/and signaltransmission with the battery pack 100. The plurality of chargerconnection terminals includes: a charger positive power terminal 433 anda charger negative power terminal 434, which are respectively usedconnected to the battery pack positive power terminal 233 and thebattery pack negative power terminal 234 to transmit electrical energy;a first charger terminal 431 configured to be connected to the firstbattery pack terminal 231 to transmit the first type of data; a secondcharger terminal 432 configured to be connected to the second batterypack terminal 232 to transmit the second type of data.

The first type of data may be the battery voltage, the charging current,the battery group voltage and the like of the battery pack 200 toimplement normal operation of the battery pack 200 and the charger 400;the second type of data may be data for data analysis of the batterypack 200, for example, SOC data and SOH data related to the currentoperating state of the battery pack, and history data or statisticaldata stored in the battery pack memory 246, for example, the number ofuses and the number of failures of the battery pack.

When the charger 400 is connected to the battery pack 200, the operationprocess of the battery pack 200 and the charger 400 is similar to thatof the power tool 300 and the battery pack 200 in the first example, andis not described herein again, except that when there is no wirelesscommunication module in the charger 400, the battery pack 200 does notswitch to the data transmission mode after the normal operation modeends, and the battery pack 200 cannot transmit the second type of datato the charger 400 through the second battery pack terminal 232.

Referring to FIG. 6, in a third example, the electrical device is aportable power supply device 100, and the portable power supply device100 includes an adapter 110 formed by a plurality of adapter interfaces111 for mounting one or more battery packs 200. In some examples, theplurality of battery packs 200 may be detachably mounted to the adapterinterface 111. In another example, the plurality of battery packs 200may be fixedly mounted to the adapter interface 111. In other examples,the plurality of battery packs 200 may be at least partially detachablymounted to the adapter interface 111. The battery pack 200 mounted tothe adapter interface 111 can obtain power from the adapter interface111, and can also output power through the adapter interface 111. Aconnection terminal 140 is provided in the adapter interface 111 forconnection with a connection terminal of the battery pack 200. Thebattery pack 200 can provide electrical power to a power tool 300,including hand-held power tool and garden power tool.

The portable power supply device 100 further includes a main controlmodule 132 for controlling the operation process of the entire portablepower supply device 100, for example, opening and closing of theportable power supply device 100, the status display, etc., and the maincontrol module 132 may specifically include a controller, the controllermay be some control signal chip (for example, a single chipmicrocomputer); a charge and discharge management module 133 connectedto the connection terminals of the main control module 132 and theadapter interface 111 for managing the charging process or dischargingprocess of the battery pack 200 connected to the adapter interface 111.The charge and discharge management module 133 may specifically includea charging circuit, a discharging circuit, and a controller, wherein thecharging circuit is electrically connected between the adapter interface111 and the controller for charging the battery pack 200 connected tothe portable power supply device 100; the discharge circuit iselectrically connected between the adapter interface 111 and thecontroller of the portable power supply device 100 for discharging thebattery pack 200 connected to the portable power supply device 100. Thecontroller of the charge and discharge management module 133 may be somecontrol signal chip (for example, a single chip microcomputer), and thecharging circuit and the discharge circuit are well known to thoseskilled in the art, and are not described herein again.

The portable power supply device 100 further includes an invertercircuit and a rectifier circuit. The inverter circuit can convert the DCpower outputted by the battery pack 200 connected to the adapterinterface 111 into AC power; the rectifier circuit can convert the ACpower connected to the adapter 110 into DC power that can charge thebattery pack 200. The inverter circuit and the rectifier circuit areeach composed of corresponding circuit board and circuit components, andthe circuit board and circuit components constituting the invertercircuit and the rectifier circuit are accommodated in a cavity formed bythe housing of the portable power supply device 100. In this example,the charging circuit includes a rectifying circuit for converting theinput alternating current into a direct current capable of charging thebattery pack 200. The discharging circuit includes an inverter circuitfor converting the direct current output by the battery pack 200connected to the adapter interface 111 into an alternating current.

Adapter 110 also includes an AC input interface that enables the adapter110 to be connected to the AC power in the grid. Specifically, the ACinput interface can be constructed as a power plug 115 as shown in FIG.6. The adapter 110 can charge the connected battery pack 200 through theinput alternating current; in a specific example, the AC input interfaceis electrically connected to the rectifier, so that the alternatingcurrent input from the AC input interface is converted to the directcurrent that the battery pack 200 is charged with.

The adapter 110 also includes an AC output interface that can be used tooutput AC power to enable the portable power supply device 100 tofunction as an AC power source. In a specific example, the power sourceof the AC output interface may be the power stored in the battery pack200 to which the adapter 110 is connected, or the power of the AC gridintroduced by the adapter 110 from the AC input interface. The AC outputinterface can be constructed in the form of a power outlet 112 as shownin FIG. 6, enabling the portable power supply device 100 to power acommon AC powered device.

The adapter 110 can use the power of the battery pack 200 to which it isconnected and output the alternating current through the AC outputinterface. In a specific example, the AC output interface is at leastelectrically connected to the inverter. The direct current from thebattery pack 200 is converted to an alternating current through theinverter and then output to the AC output interface.

The adapter 110 also includes a DC output interface to enable theadapter 110 to output direct current. Specifically, the DC outputinterface may be configured as a 5V USB interface 113 as shown in FIG.6, or may be configured as a 12V vehicle power interface 114 as shown inFIG. 6; of course, the DC output interface can also be constructed inother forms and output other voltages such as 19V, 36V. In a specificexample, the power source of the DC output interface may be the powerstored in the battery pack 200 to which the adapter 110 is connected, orthe DC power of other devices introduced by the adapter 110 from the DCinput interface, such as the electrical energy stored in the storagebattery of an automobile.

The adapter 110 can also include a DC input interface for connecting theadapter 110 to DC power. The adapter 110 can charge the battery pack 200from the direct current that is external to its battery pack 200, andcan also be used by other electrical devices. For example, the user canmake use of the battery of the automobile through the DC input interfaceto charge the battery pack 200 connected to the adapter 110. Of course,the user can also use the DC output interface of the adapter 110 tocharge the battery of the automobile to solve the problem that theautomobile cannot be started due to emptied storage battery. The DCinput interface can also be constructed as a USB interface 114 or a 12Vinterface 115 as shown in FIG. 6.

The adapter interface 111 of the portable power supply device 100 can beadapted to a plurality of battery packs 200, which can be either thebattery packs 200 having the same rated voltage or the battery packs 200having different rated voltages; the charging circuit of the portablepower supply device 100 can make one of the battery packs 200 having ahigher voltage or/and capacity charge another battery pack 200 having alower voltage or/and capacity; of course, the portable power supplydevice 100 can also incorporate its internal circuitry (for example, abooster circuit) to make the battery pack 200 having a lower voltageor/and capacity charge the battery pack 200 having a higher voltageor/and capacity.

The plurality of connection terminals provided in the adapter interface111 of the portable power supply device 100 include a positive powerconnection terminal 143, a negative power connection terminal 144, afirst connection terminal 141, and a second connection terminal 142.

The positive power connection terminal 143 and the negative powerconnection terminal 144 of the portable power supply device 100 arerespectively connected to the battery pack positive power terminal andthe battery pack negative power terminal of the battery pack to transmitelectric energy. The first connection terminal 141 is for connectingwith the first battery pack terminal 231 to transmit the first type ofdata; the second connection terminal 142 is for connecting with thesecond battery pack terminal 232 to transmit the second type of data.

Wherein, the first type of data is data for normal operation when theportable power supply device 100 and the battery pack 200 are usedtogether. For example, when the portable power supply device 100 chargesor discharges the battery pack 200 mounted on the adapter interface 111,the temperature, current, voltage, and the like of the battery pack arecollected to ensure the normal operation and protection of the portablepower supply device 100 and the battery pack 200.

The second type of data is data for data analysis, for example, theoperating parameters of the battery pack 200 and the power tool 300stored in the memory of the battery pack 200, including the faultinformation, the number of uses, the voltage, the current, the actualcapacity of the battery pack 200, the usage frequency, the number offaults, the voltage, the current, the temperature, the speed, and thetorque of the power tool 300. The second type of data not only providesdata support for research and development, but also facilitatesmaintenance staff to carry out fault diagnosis and fault repair for thebattery packs 200 and the power tool 300, saving manpower and materialresources.

In the present example, the portable power supply device 100 has anormal operation mode and a data transmission mode; in the normaloperation mode, the portable power supply device 100 charges the batterypack 200 or discharges the battery pack 200 through the connectionterminal in the adapter interface 111. The portable power supply device100 and the battery pack 200 transmit the first type of data when theportable power supply device 100 and the battery pack 200 are used fornormal operation through the first connection terminal 141 and the firstbattery pack terminal 231; in the data transmission mode, the portablepower supply device 100 and the battery pack 200 transmit the secondtype of data for data analysis of the battery pack 200 and/or the powertool 300 through the second connection terminal 142 and the secondbattery pack terminal 232. In the present example, the battery pack 200includes a battery pack memory 246 for storing data of the battery pack200 and data of the power tool 300. The battery pack 200 and the powertool 300 do not include a wireless communication module.

By providing two sets of connection terminals for transmitting data, itis possible to ensure the normal operation of the portable power supplydevice 100 interfaced with the battery pack 200, as well as the dataacquisition from the portable power supply device 100 and/or the batterypack 200 and/or power tool 300, providing data support for research anddevelopment of the portable power supply device 100 and/or the batterypack 200 and/or the power tool 300, and facilitating maintenance staffto carry out fault diagnosis and fault repair of the portable powersupply device and/or the battery pack and/or the power tool, savingmanpower and material resources.

In an example, the portable power supply device 100 further includes acommunication device 120. The communication device 120 includes awireless communication module 121 for establishing a wirelesscommunication connection between the portable power supply device 100and an external device. The portable power supply device 100 cantransmit data to or receive data from an external device through thewireless communication module. In a specific example, the wirelesscommunication module 121 of the portable power supply device 100 may bea wireless router of a local area network, which may directly access theInternet to enable other wireless communication devices in the localarea network to access the Internet, and may also connect to a wirelesscommunication device capable of accessing the Internet to enable otherwireless communication devices in the local area network to access theInternet. Of course, the wireless communication device may also onlyenable data communication among the wireless communication deviceswithin the local area network. The wireless communication device mayrealize wireless communication by means of Bluetooth, WiFi, NFC, ZigBee,and the like.

Thus, the second type of data transmitted between the portable powersupply device 100 and the battery pack 200 can be transmitted to theexternal device through the wireless communication module 121. Theexternal device has data processing and analysis functions, and thus thedata transmitted to the external device through the wirelesscommunication module provides data support for research and developmentof the portable power supply device 100 and/or the battery pack 200and/or the power tool 300, and facilitates maintenance staff to performfault diagnosis and fault repair of the power supply device and/or thebattery pack and/or the power tool, thereby saving manpower and materialresources.

Referring to FIG. 8, the external devices include a remote server 20having data processing and analysis functions, and the remote serverincludes a wireless communication module, and the portable power supplydevice 100 and the remote server 20 transmit data through respectivewireless communication modules. Of course, the external device can alsotransmit data (for example, an upgrade program) and instructions (forexample, a boot instruction) to the portable power supply device 100through the wireless communication module.

The external devices may further include a mobile terminal device 21having a data transmitting and receiving function; the mobile terminaldevice including a wireless communication module, the mobile terminaldevice 21, the portable power supply device 100, and the remote server20 transmit data through respective wireless communication modules. Inthis way, the mobile terminal can transmit instructions or data to theelectrical device through the wireless communication module, and canalso receive data of the electrical device. The mobile terminal device21 includes a display module capable of displaying informationtransmitted from the portable power supply device 100, including thecurrent state of the portable power supply device 100, such as theremaining power and the remaining time of the portable power supplydevice 100, which is convenient for the user to check and determinewhether to charge or discharge the battery pack, and whether to end thework in progress to save electric power.

In the present example, the external devices include the remote server20 and the mobile terminal device 21. The mobile terminal device 21 hasa receiving and transmitting function, and includes a wirelesscommunication module for performing data transmission and reception. Themobile terminal device 21 may be an electronic device such as a mobilephone, a dedicated handheld device, or a tablet computer. The remoteserver 20 has data processing and analysis functions, and includes awireless communication module. The portable power supply device 100, theremote server 20, and the mobile terminal device 21 transmit datathrough respective wireless communication modules.

In this way, the portable power supply device 100 can transmit thecollected data to the remote server 20 through the wirelesscommunication module 121 for data processing and analysis, providesupport for research and development and fault diagnosis, or transmitthe collected data to the mobile terminal device 21 for the user tocheck the situation of the portable power supply device 100 or thebattery pack 200 or the power tool 300 to arrange the next job, forexample, determine whether the number of failures of the power tool 300has reached the upper limit to need repair, and whether the temperatureof the battery pack 200 has reached the upper limit to pausedischarging, and whether the portable power supply device 100 needs topause output during outdoor work or travel to ensure sufficient powerfor return.

The portable power supply device 100 further includes identityinformation, and the first battery pack terminal 231 is furtherconfigured to acquire identity information of the portable power supplydevice 100 through the first connection terminal 141, the identityinformation including whether the portable power supply device 100 hasthe wireless communication module 121 described above. Thereby, thefirst battery pack terminal 231 can not only transmit the first type ofdata for the portable power supply device 100 and the battery pack 200for normal operation, but also detect whether the portable power supplydevice has the wireless communication module 121, realizing twofunctions with one terminal to reduce the number of terminals used.

In some specific examples, the identity information may be a serialnumber stored in the memory of the portable power supply device 100, andthe memory may be located in the charge and discharge management module133, and the memory is further capable of storing the data of theportable power supply device 100 and the data of the battery pack 200and/or the power tool 300 that the battery pack transmits through thesecond connection terminal 142 and the second battery pack terminal 232.This has the advantage that the data of the battery pack 200 and thepower tool 300 can be collected by the portable power supply device 100without separately collecting the data of the battery pack 200 and thepower tool 300 through other devices (such as the diagnostic device, thewireless communication module of the battery pack 200 and the power tool300), which makes the data collection process simpler and cheaper.

The serial number is the device model of the portable power supplydevice 100, and the battery pack 200 can read the serial number throughthe first battery pack terminal 231 to determine whether the portablepower supply device 100 has the wireless communication module 231; inother specific examples, the resistance value of an identificationresistor can be used to represent the identity information of theportable power supply device 100. The identification resistor isconnected to the first connection terminal 141. The battery pack 200 canmeasure the voltage of the identification resistor through theconnection of the first battery pack terminal 231 and the firstconnection terminal 141, thereby obtaining the resistance value of theidentification resistor based on the voltage, thereby determiningwhether the portable power supply device 100 has the wirelesscommunication module 121.

In the present example, the battery pack controller 241 is configuredto: determine whether the portable power supply device 100 has thewireless communication module 121 according to the identity informationof the portable power supply device 100 acquired by the first batterypack terminal 231; and after determining that the portable power supplydevice 100 has the wireless communication module 231, the second type ofdata is transmitted between the second connection terminal 142 and thesecond battery pack terminal 232. The battery pack controller 241 may bea chip having a control function such as a single chip microcomputer.

When the portable power supply device 100 has the wireless communicationmodule 121, can the second type of data be transmitted between thesecond connection terminal 142 and the second battery pack terminal 232,the advantage being to avoid the situation when the portable powersupply device 100 does not have the wireless communication module 121and yet the battery pack 200 still transmits the second type of data fordata analysis of the battery pack 200 and/or the power tool 100 to theportable power supply device 100 through the second connection terminal142 and the second battery pack terminal 232, causing the second type ofdata to take up the memory space of the portable power supply device 100in addition to not transmitted to the external device through theportable power supply device 100. Only when the portable power supplydevice 100 has the wireless communication module 121, can the secondtype of data be transmitted between the second connection terminal 142and the second battery pack terminal 232, enabling timely transmit ofthe data of the portable power supply device 100 and/or the battery pack200 and/or the power tool 300 to the external device through thewireless communication module 120 for data processing and analysis.

In addition, the portable power supply device 100 collects data of theportable power supply device 100, the battery pack, and the power tool,and then transmits the collected data to the external device through thewireless communication module 121 of the portable power supply device100, without separately collecting the data of the portable power supplydevice 100, the battery pack 200 and the power tool 300 through otherdevices, the data collection process is simpler and the cost is lower.

In an example, after the normal operation mode ends, the first batterypack terminal 231 can acquire the identity information of the portablepower supply device 100 through the first connection terminal 141. Thishas the advantage that after the normal operation mode ends, that is,after the portable power supply device 100 completes charging ordischarging the battery pack 200, the first battery pack terminal 231acquires the identity information of the portable power supply device100 through the first connection terminal 141. Entering the datatransmission mode if the portable power supply device 100 has thewireless communication module 121 can avoid switching to the datatransmission mode suddenly when the normal operation mode has not ended,which causes system disorder and affects the normal operation of thebattery pack 200 and the portable power source, thereby damaging thebattery pack and portable power supply device 100, as well as thereliability of the transmitted data. And after the normal operation modeends, if the portable power supply device 100 has the wirelesscommunication module 121, the data of the portable power supply device100 and/or the battery pack 200 and/or the power tool 300 can be sentout through the wireless communication module 121 in time to avoid longtime occupation of the memory.

Referring to FIG. 7, the present disclosure also provides a portablepower source system including the portable power supply device 100, aplurality of battery packs 200, and a power tool 300 adapted to therespective battery packs 200. Referring to the connection schematic ofthe portable power source system depicted in FIG. 7, the portable powersupply device 100 can be connected to the battery pack 200, and thebattery pack 200 can be connected to the portable power supply device100 and the power tool 300.

The battery pack is the battery pack 200 as described before, and thepower tool 300 is the electric power tool 300 as described before.

When the battery pack 200 is mounted to the power tool 300, in thenormal operation mode, the battery pack 200 discharges to the power tool200 through the connection terminal, and the first type of data for thenormal operation of the battery pack 200 and the power tool 300 istransmitted between the first battery pack terminal 231 and the firsttool terminal 341, including the voltage, temperature, discharge currentof the battery pack 200, and the load current, stop discharge signal ofthe power tool 300 to realize the normal operation of the battery pack200 and the power tool 300 and to protect the battery pack 200 and thepower tool 300.

When the battery pack 200 is mounted to the power tool 300, in the datatransmission mode, the power tool 300 transmits the second type of datafor data analysis to the battery pack 200 through the second toolterminal 342 and the second battery pack terminal 232. The second typeof data is the operating parameters of the power tool 300, such as thefrequency of use of the power tool 300, the number of failures, voltage,current, temperature, speed, torque, and the like. In the presentexample, the power tool 300 does not have a wireless communicationmodule.

In an example, when the battery pack 200 is mounted to the power tool300, it first operates in the normal operation mode, and the firstbattery pack terminal 231 and the first tool terminal 341 transmit thefirst type of data for normal operation of the battery pack 200 and thepower tool 300. When the normal operation mode ends, the battery pack200 and the power tool 300 are directly switched to the datatransmission mode, and the power tool 300 sends the data of the powertool 300 to the battery pack 100 through the second tool terminal 342and the second battery pack terminal 232, such as the frequency of use,the number of failures, voltage, current, temperature, speed, and torqueof the power tool 300. In the present example, the battery pack 200 doesnot need to detect whether the power tool 300 has a wirelesscommunication module, and the wireless communication module provided onthe power tool does not need to transmit the second type of data to theexternal device. Instead, the battery pack 200 collects the second typeof data of the power tool 300 through the battery pack 200. After thebattery pack 200 is mounted to the portable power supply device 100, thebattery pack 200 transmits the collected second type of data to theportable power supply device 100 through the second battery packterminal 232, and to the external device through the wirelesscommunication module 121 of the portable power supply device 100. Thissaves the wireless communication module on the power tool 300, reducesthe cost, collects more concentrated data and facilitates dataprocessing.

The battery pack memory 246 of the battery pack 200 is used for storingthe data of the battery pack 200 and data of the power tool 300. Whenthe battery pack 200 is mounted to the portable power supply device 100,in the data transmission mode, the battery pack 200 transmits the secondtype of data for data analysis stored in the memory of the battery pack200 to the portable power supply device 100 through the second batterypack terminal 232. The second type of data includes data of the batterypack and the power tool.

In this way, the battery pack 200 can collect not only its own data butalso the data of the power tool 300, and the data collection is moreconvenient, and it is not necessary to separately collect data of thepower tool 300 and the battery pack 200 through other devices.

Alternatively, the power tool 300 has a memory for storing parameterdata of the power tool 300 including data such as frequency of use,number of failures, voltage, current, temperature, speed, torque, andthe like. The battery pack 200 is capable of acquiring the data storedin the memory of the power tool 300 through the second battery packterminal 232.

With continued reference to FIG. 7, the portable power supply device 100includes a communication device 120, a main control module 132, aninverter module 131, and a charge and discharge management module 133.Wherein the charge and discharge management module 133 is configured tomanage the charging and discharging process of the battery pack 200,including coordination of the charging and discharging order of eachbattery pack. The charge and discharge management module 133 includes adata memory for storing data of the portable power supply device 100,the battery pack 200, and the power tool 300.

The communication device 120 includes a wireless communication module121 for wirelessly communicating with an external device (such as theremote server 20, the mobile terminal device 21, etc.). Thecommunication device 120 may be a universal module with a unifiedinterface or protocol that can be applied to different types of devices.The communication device 120 has any one or more of the communicationfunctions of BLE, WIFI, zigbee, and cellular mobile data communication.The communication device 120 may alternatively be a specialized modulethat implements any one or more of the communication functions of BLE,WIFI, zigbee, and cellular mobile data communication, but does not havea unified interface or protocol. The communication device 120 may alsobe a cellular-based Narrow Band Internet of Things (hereinafter referredto as “NB-IOT”), which is built on a cellular network and can bedirectly deployed on a GSM network, a UMTS network or an LTE network. Noconfiguration is required to directly connect to the network, directlyaccess the remote server 20 or the mobile terminal device 21, and thecommunication can be realized as long as there is signal coverage. Inthis way, the NB-IOT can realize data collection, condition monitoring,and program update operations of the power tool 300, the battery pack200, and the portable power supply device 100 through cellular mobilecommunication.

In an example, the communication device 120 further includes a networkdistribution module 123 for selecting the communication method (forexample, Bluetooth or WIFI mode) to communicate with an external device.The network distribution module may include a network distributionbutton 1231 for the user to select one of the communication modesthrough the network distribution button 1231 to establish acommunication connection with the external device. The user can alsodirectly guide the network distribution process with the mobileapplication, and the network distribution process also employs userbinding so that no rebinding is needed. For example, the communicationdevice 120 includes a Bluetooth module 1212 and a WIFI module 1211. Whenthe user sets the communication device 120 to communicate in the WIFImode with the mobile phone application, the control privileges of theportable power supply device through the Bluetooth mode can beautomatically obtained. When the user sets the communication device 120to communicate in the Bluetooth method with the mobile phoneapplication, the control privileges of the portable power supply devicethrough the WIFI mode can be automatically obtained.

In an example, the network distribution process and the identityverification process by the WIFI method include the following steps:long press the network distribution button for a few seconds, theportable power supply device 100 enters the configuration mode; the useraccesses the application of the mobile terminal device 21 having thenetwork communication function through a mobile phone or the like andclicks on the WIFI to add device; the portable power supply device 100is connected to the router and automatically registers on the remoteserver 20; the mobile terminal device 21 and the portable power supplydevice 100 are in the same local area network, and the user requestsidentity information of the portable power supply device 100 from theportable power supply device 100 through the application program on themobile terminal device 21, and binds the user mobile terminal device 21and the portable power supply device 100 through the identityinformation. At this time, the portable power supply device 100 isalready in the device list in the application of the user mobileterminal device 21.

The communication device 120 may further include a storage module 122for storing data information sent by the external device (for example,an upgrade file) and data information sent by the internal module of theportable power supply device 100 (for example, the state data of theportable power supply device 100, the battery pack 200, and the powertool 300). The communication device may further include a verificationmodule for verifying whether the received data information is correct.

The communication device 120 is electrically connected to the maincontrol module 132 of the portable power supply device 100. The maincontrol module 132 receives an instruction from an external device sentby the wireless communication module of the communication device 120,and manages the normal operation of the entire portable power supplydevice 100. The charge and discharge management module 133 is connectedto the connection terminals in the main control module 132 and theadapter interface 111 to manage the charging process or the dischargingprocess of the battery pack 200 connected to the adapter interface 111,and collect data and transmit the collected data to the external devicethrough the wireless communication module 121 of the communicationdevice 120. The inverter module 131 is electrically connected to themain control module 132, and is under the management of the main controlmodule 132 in the operation mode, and is connected to the communicationdevice 120 in parallel to the main control module 132 through the bus inthe upgrade mode. The inverter module 131 receives the upgradescheduling management of the communication device 120 to complete theprogram upgrades. The inverter module 131 includes an inverter forconverting the received DC power into AC power output.

The battery pack 200 can be adapted to the adapter interface 111 of theportable power supply device 100 to be electrically connected to thecharge and discharge management of the portable power supply device 100through the battery pack connection terminal and the connection terminalin the adapter interface 111 on the portable power supply device 100. Inthe module 133, the battery pack 200 is connected to thecharging/discharging management module 133 of the portable power supplydevice 100 by the connection of the battery pack connection terminal tothe connection terminal of the portable power supply device. The batterypack includes a battery pack positive power terminal 233, a battery packnegative power terminal 234, a first battery pack terminal 231 and asecond battery pack terminal 232, and a controller (not shown).

The portable power supply device 100 has a positive power connectionterminal 143, a negative power source connection terminal 144, a firstconnection terminal 141, and a second connection terminal 142, whereinthe positive power connection terminal 143 and the negative power sourceconnection terminal 144 are respectively used to connect to the batterypack positive power terminal 233 and the battery pack negative powerterminal 244 for transmitting electrical energy; the first connectionterminal 141 is for connecting with the first battery pack terminal 231to transmit the first type of data; and the second connection terminal142 is for connecting with the second battery pack terminal 232 totransmit the second type of data. When the battery pack is connected tothe portable power supply device 100, the battery pack 200 and theportable power supply device 100 realize the transmission of the firsttype of data through the connection of the first connection terminal 141and the first battery pack terminal 231, and the transmission of thesecond type of data through the connection of the second connectionterminal 142 and the second battery pack terminal 232.

The portable power supply device 100 has a normal operation mode and adata transmission mode. In the normal operation mode, the portable powersupply device 100 transmit the first type data for the normal operationof the portable power supply device 100 and the battery pack 200 throughthe first connection terminal 141 and the first battery pack terminal231. In the data transmission mode, the power supply device 100 and thebattery pack 200 transmit the second type of data for data analysis ofthe battery pack 200 and/or the power tool 300 through the secondconnection terminal 142 and the second battery pack terminal 232.

Wherein, the first type of data is data for normal operation when theportable power supply device 100 and the battery pack 200 are usedtogether. For example, when the portable power supply device 100 chargesor discharges the battery pack 200 mounted on the adapter interface 111,the temperature, current, voltage, and the like of the battery pack arecollected to ensure the normal operation and protection of the portablepower supply device 100 and the battery pack 200. The second type ofdata is data for data analysis, for example, the operating parameters ofthe battery pack 200 and the power tool 300 stored in the memory of thebattery pack 200, including the fault information, the number of uses,the voltage, the current, the actual capacity of the battery pack 200,the usage frequency, the number of faults, the voltage, the current, thetemperature, the speed, and the torque of the power tool 300. The secondtype of data not only provides data support for research anddevelopment, but also facilitates maintenance staff to carry out faultdiagnosis and fault repair for the battery packs 200 and the power tool300, saving manpower and material resources.

The portable power supply device 100 has identity information, and thefirst battery pack terminal 231 is further configured to acquireidentity information of the portable power supply device 100 through thefirst connection terminal 141, the identity information includingwhether the portable power supply device 100 has the wirelesscommunication module 121, in the present example, the portable powersupply device 100 has a wireless communication module 121. In anexample, after the normal operation mode ends, the first battery packterminal 231 can acquire the identity information of the portable powersupply device 100 through the first connection terminal 141.

Specifically, after the battery pack 200 is mounted to the adapterinterface 111 of the portable power supply device 100, the portablepower supply device 100 first operates in a normal operation mode, andafter the normal operation mode ends, the first battery pack terminal231 obtains the identity information of the portable power supply device100 through the first connection terminal 141, and determines that theportable power supply device 100 has the wireless communication module121, then the controller controls the battery pack 200 to switch to thedata transmission mode to transmit the second type of data between thesecond connection terminal 142 and the second battery pack terminal 232.

In the portable power source system described above, the battery pack200 is capable of collecting its own data and the data of the power tool300, the portable power supply device 100 is capable of collecting itsown data, the data of the battery pack 200, and the data of the powertool 300 stored in the battery pack 200. The portable power supplydevice 100 transmits the collected data of itself, the data of thebattery pack 200, and the data of the power tool 300 to the externaldevice through the wireless communication module 121 for data processingand analysis.

In order to facilitate the analysis and processing of the received databy the remote server 20, the data of the portable power supply device100, the battery pack 200, and the power tool 300 uploaded by theportable power supply device 100 are categorized into three types:real-time data, statistical data, and history data. The data isrespectively stored in specified memory partitions of the data storageof the charge and discharge management module 133 according to differenttypes of history data, statistical data, and real-time data. When thespecified partition is used up, the original data will be overwritten bythe current data. This scrolling storage method saves the latest dataand saves the storage space.

Specifically, the real-time data of the power tool 300 includesoperating parameters during operation of the power tool 300, such asreal-time current, real-time voltage, real-time temperature, real-timetorque, etc. The statistical data of the power tool 300 includesaccumulated working time, number of failures, and the like. Thereal-time data of the battery pack 200 includes the total voltage of thebattery pack 200, the temperature of the battery pack 200, the minimumcell voltage, the operating state of the battery pack, etc. Thestatistical data of the battery pack 200 includes the cumulative time ofcharge and discharge, the number of charge and discharge, and the numberof over temperature during charge and discharge, the remaining capacity,the temperature distribution of the charging and discharging process,etc. The history data of the battery pack 200 includes the battery packfailure state, the battery pack temperature, the battery pack voltage,the battery pack charge and discharge current, the single cell voltage,and the like. The real time data of the portable power supply device 100includes output current, output power, charge or discharge state foreach battery pack, charge or discharge current/voltage for each batterypack, networked state, and the like. The history data of the portablepower supply device 100, the battery pack 200, and the power tool 300are historical work data stored in the respective memories of theportable power supply device 100, the battery pack 200, and the powertool 300.

In order to distinguish data of different products, device identityinformation may be added or associated with the above three types ofdevices in order to track the full life cycle state of the product. Insome examples, the device identity information is a unique identifier.In the present example, the devices include the portable power supplydevice 100, the battery pack 200, and the power tool 300.

Since the data is divided into real-time data, statistical data, andhistory data with time attributes, it is necessary to add or associatetime information to the above data. In other words, at least one of theabove three types of data, real-time data, statistical data, and historydata contains time information, and such data with time information isnecessary for big data analysis later. Due to the inconsistency of timein various regions and countries of the world, in order to ensure thetime synchronization or time consistency for data in various regions,the time in the data is measured in UTC. Each product or device acquiresworld standard time from an external device with world standard timeinformation. For example, in the portable power system, the worldstandard time can be acquired by the wireless communication module 121of the communication device 120 from the remote server 20 or the mobileterminal device 21, and then requested by the charge and dischargemanagement module 133 of the portable power supply device 100 from thecommunication device 120 to calibrate its own time information. When thebattery pack 200 is mounted to the adapter interface 111 of the portablepower supply device 100, the battery pack 200 may request the standardtime from the charge and discharge management module 133. When thebattery pack 200 is connected to the power tool 300, the power tool 300may request the standard time from the battery pack 200, and pass thestandard time step by step in this way. In this way, the data generatedby the portable power supply device 100, the battery pack 200, and thepower tool 300 can maintain the time synchronization or time consistencyof the data information in various regions, which facilitates unifiedmanagement.

One example of the data acquisition process of the portable power systemis described in detail below.

The battery pack 200 is interfaced with the power tool 300. After theswitch of the power tool 300 is triggered, the power tool 300 sends atime request to the battery pack 200 to obtain the current standard timeinformation of the battery pack 200 for recording and processing thedata information of the power tool 300. The battery pack 200 replies thestandard time information to the power tool 300; after receiving thestandard time, the power tool 300 calibrates its own time and returnstime calibration confirmation information to the battery pack 200; afterthe switch of the power tool 300 is released, and before the removal ofthe battery pack 200 or before the power tool 300 is powered off, thepower tool 300 transmits the data stored in its own memory to thebattery pack 200; the battery pack 200 receives the data from the powertool 300 and stores it in its own memory.

Specifically, the memory of the battery pack 200 can be divided into anindex partition, a statistical data partition of the power tool 300, astatistical data partition of the battery pack 200, and a history datapartition. The above memory partitions can be divided into two types ofstorage forms, one is stable storage, and the other one is rollingstorage, that is, after the specified partition is used up, the new datacovers the old data. This method of data storage can also be extended tothe portable power supply device 100, the power tool 300, and the remoteserver 20.

The information sent by the battery pack 200 to the power tool 300 andthe information sent by the power tool 300 to the battery pack 200include respective identity information of the battery pack 200 and thepower tool 300, and the data information sent by the power tool 300 tothe battery pack 200 includes the time information of the world standardtime. The battery pack 200 communicates with the power tool 300 throughthe second battery pack terminal 232 and the second tool terminal 342,and may adopt a serial communication method.

When the battery pack 200 is removed from the power tool 300 andinterfaced with the portable power supply device 100 for charging ordischarging, the battery pack 200 transmits time request information tothe portable power supply device 100, and the portable power supplydevice 100 replies its own standard time to the battery pack 200. Afterreceiving the standard time, the battery pack 200 calibrates its owntime and feeds back the time calibration confirmation information to theportable power supply device 100; the portable power supply device 100polls the real-time data, statistical data, history data of the batterypack 200, and/or the data information of the power tool 300 stored inthe memory of the of the battery pack 200; the battery pack 200transmits corresponding real-time, statistical or history data to theportable power supply device 100 in accordance with instructions fromthe portable power supply device 100.

The charge and discharge management module 133 retrieves the statisticaldata of each battery pack in a fixed order when interfaced with thebattery packs, and collects the statistics data of one battery pack andthen retrieves the next battery pack until the statistics data of everybattery pack is retrieved. The charge and discharge management module133 can start to retrieve the history data of each battery pack 200 in apreset order after the communication device 120 is connected to thenetwork and the statistic data has been retrieved, retrieve the batterypack 200 one after another until the history data of all the batterypacks 200 has been retrieved. Since the history data is generated at anytime, the charge and discharge management module 133 continuously takesturns to retrieve the history data of each battery pack 200.

The charge and discharge management module 133 of the portable powersupply device 100 collects data of the portable power supply device 300itself and receives data of the battery pack 200 and the power tool 300,and transmits it to the remote server 20 or the mobile terminal device21 through the communication device 120. The battery pack 200communicates with the charge and discharge management module 133 of theportable power supply device via the communication function of thesecond battery pack terminal 232. When the communication device 120 isconnected to the network, the real-time data, statistical data, andhistory data of the portable power supply device 100, the battery pack200, and the power tool 300 collected by the charge and dischargemanagement module 133 can be transmitted to the remote server 20 or themobile terminal device 21. The data of the portable power supply device100, the battery pack 200, and the power tool 300 collected by theportable power supply device 100 saves data collection devices comparedto separately collecting data for the portable power supply device 100,the battery pack 200, and the power tool 300. In addition, the data ismore concentrated, which can facilitate data processing, for example,data deduplication and data classification, etc., saving manpower andmaterial time.

In an example, the communication device 120 includes a Bluetooth module1212 and a WIFI module 1211. The portable power supply device 100 cansimultaneously communicate wirelessly with the remote server and themobile terminal device by means of Bluetooth and WIFI. Specifically, theportable power supply device may upload the information to the remoteserver 20 in a WIFI manner through the WIFI module 1211 in thecommunication device 120, or may send the information to the mobileterminal device 21 via the Bluetooth module 1212 in a Bluetooth manner,the mobile terminal device. The information received by the portablepower supply device 100 can also be uploaded to the remote server 20.The portable power supply device 100 transmits the acquired data to theremote server 20, which analyzes and processes the data.

Since the communication device 120 can send data to the remote server 20through WIFI or Bluetooth, the data received by the remote server 20 mayhave data with or associated with the same time and the same deviceidentity information, in order to reduce the amount of data stored andfacilitate data sorting, the deduplication function can be introduced inthe remote server 20, that is, the function of distinguishing the orderof data according to the time to remove one of the data with the sametime and device information in order to avoid data duplication andconflict.

Any authorized person can retrieve the required data from the remoteserver 20, and based on the data, the usage of the portable power supplydevice 100, the battery pack 200, and the power tool 300 can beunderstood, and based on the usage, data analysis results guide therelevant work, so that the staff does not need to go to the site forresearch and analysis, which is convenient for work and reduces costs.

The remote server 20 analyzes and processes the data and transmits therelevant operation information to the portable power supply device 100or the mobile terminal device 21. Specifically, the remote server maytransmit the above operation information to the portable power supplydevice 100 by WIFI, and the portable power supply device 100automatically performs related operations. The remote server 20 may alsosend the operation information to the mobile terminal device 21 by WIFI.The mobile terminal device 21 can display the operation information, andthen the user manually operates the portable power supply device 100through the mobile terminal device 21, or the mobile terminal device 21transmits the operation information to the portable power supply device100 in a Bluetooth manner, and the portable power supply device 100automatically performs the related operations.

Referring to FIGS. 9-11, the user can remotely control the portablepower supply device 100 by using the mobile terminal device 21 such as amobile phone or the remote server 20 to execute remote operations suchas turning on, turning off, timing on, timing off, and locking of theportable power supply device 100.

In one example, when the portable power supply device 100 is in the onstate or the standby mode, the user can remotely control the poweroutput of the portable power supply device 100 through an externaldevice (for example, the remote server 20 or the mobile terminal device21), that is, remotely turn the AC power output terminal or DC poweroutput terminal on or off. The user can also set the switching time ofthe AC power output terminal or the DC power output terminal of theportable power supply device 100, that is, the timed control of theopening and closing of the AC power output terminal or the DC poweroutput terminal. It should be noted that when the portable power supplydevice 100 is in the state of charging the battery pack 200, the usercannot turn off the AC power output terminal and/or the DC power outputterminal by manual or remote control to prevent damage to the portablepower supply device 100 and/or the battery pack 200. In addition, thepower output of the portable power supply device 100 is based on theremaining capacity of the portable power supply device 100, and when theremaining capacity of the portable power supply device 100 is less thana certain preset value (for example, 15%), the remote control functioncannot be activated. For the timing function, when the portable powersupply device 100 receives the control instruction from the externaldevice to start timing and set it as the start time of the preset event,the timed controlled preset event can be stored in the portable powersupply device for a preset time (for example, 12 hour). If the bus powerof the portable power supply device 100 is manually turned off, thepreset event will be cleared.

In order to prevent the portable power supply device 100 from beingstolen or mishandled, the user can also remotely lock the portable powersupply device 100 with the remote server 20 or the mobile terminaldevice 21. In one example, for security reasons, the user can only lockand unlock the portable power supply device 100 with the mobile terminaldevice 21. The portable power supply device 100 is completely unusablewhen locked, and can only be unlocked by manual setting, specifically,cut off the bus power cannot unlock.

It should be noted that the portable power supply device 100 can receivea control instruction from an external device, which may come fromBluetooth or WIFI or other communication method. In order to avoidconflicts between control instructions, when there are multiplecommunication modes, the priority mechanism can be used to pre-set thepriority of each communication mode, for example, to prioritize theBluetooth control instruction.

In one example, the user remotely controls the portable power supplydevice 100 through an application on the mobile terminal device 21 suchas a mobile phone having a network communication function, and themobile terminal device 21 can display various information on theportable power supply device 100, including the output power of theportable power supply device 100, the total remaining charging time, theusage status of each output terminal and/or input terminal, the powerconsumption of each battery pack and/or the remaining power, the voltageof each battery pack, whether it is in over-temperature protection,low-voltage protection. The mobile phone can also display faultinformation for the portable power supply device, and the application onthe mobile terminal device 21 can provide a solution to the fault. Whenthe above fault message appears, the application can also provide asolution, for example, prompting the user to turn on or off the portablepower supply device, contact the after-sales, and the like.

The portable power supply device 100 can report its fault information tothe mobile terminal device 21 via Bluetooth or WIFI, and the mobileterminal device 21 can report the fault to the remote server 20. Theremote server 20 records the failure information and synchronizes thefailure information to the after-sales service.

The fault information reported by the portable power supply device 100includes recoverable errors and unrecoverable errors, and therecoverable errors include over-temperature, overload, low voltage,etc., and the user can solve the recoverable error according to theprovided solution; the unrecoverable errors include inverter error,rectifier error, fan error, charge and discharge management moduleerror, etc., users generally cannot solve unrecoverable errors, and needto synchronize the error to the after-sales service. The after-salesprovide solutions.

The application on the mobile terminal device 21 can calculate theremaining time or the remaining charging time of the portable powersupply device 100 based on the output power of the portable power supplydevice 100. The user can also set the operating time for the portablepower supply device 100 through the application, and the portable powersupply device 100 outputs the maximum power as much as possibleaccording to the set time. The application may also give advice todisconnect and/or remove the battery pack 200 interfaced with theportable power supply device 100, the desired remaining time orremaining charging time, recommendations for turning on and/or off poweroutput, remote turning on and/or off the power output terminals.

With continued reference to FIGS. 9-11, the portable power supply device100 can send a reminder directly or through the remote server 20 to theuser mobile terminal device 21, depending on its own conditions and/ordata analysis information of the remote server 20. For example, when theportable power supply device 100 is in an overload state, a low batterylevel, a completed charging state, or the like, the portable powersupply device 100 transmits a reminder to the user mobile terminaldevice 21 directly or transmits a reminder to the user mobile terminaldevice 21 through the remote server 20. The remote server 21 analyzesand processes the received data information of the portable power supplydevice 100, the data information transmitted by the user mobile terminaldevice 21, and other information, and can recognize the user's habitsand provide customized information or reminders.

When there is a problem with the software of a certain device in theportable power system (for example, the portable power supply device100, the battery pack 200, or the power tool 300) or a program change orsoftware upgrade is required for the already shipped product, the deviceneeds to be disassembled and debugged to implement product softwarechanges, which not only requires a lot of manpower and resources, butalso delays the project cycle. For this reason, there is an urgent needfor a convenient software change or upgrade method.

To address the above issues, a method of applying boot loader to changeor upgrade product software is provided.

The boot loader is a Microcontroller Unit (MCU) that operates part ofits own flash memory to realize application program changes and toimplement product firmware upgrades. In this way, it is possible tocommunicate with the MCU inside the product through the reservedcommunication interface on the product, so that the MCU calls the bootloader to make changes to the application program, and implementsproduct firmware update and upgrade.

Referring to FIG. 12, using the boot loader to implement firmwareupgrade requires writing a two-part program when designing the firmwareprogram. The first part of the program does not perform normal functionoperations, it only receives external data and instructions bycommunication, and verifies the information of the second part of theprogram (whether complete, version information, etc.) and updates thesecond part of the program, that is, the boot loader 801; the secondpart of the program is the corresponding product function code, that is,the application program 802. The flash memory 800 allocates memorypartitions to the boot loader 801 and the application program 802 withrespect to actual conditions. For example, the flash memory 800allocates two partitions SA0 and SA1 to the boot loader 801, andallocates one partition SA2 to the application program 802. The flashmemory may also stores identity information 803 about the device, whichmay be stored in partition SA3.

The boot loader 801 has the functionality to read and write programs, itcan read the data information stored in the flash memory 800, and writethe data information into the storage module, it can also overwrite allthe application programs stored in the flash memory 800 with programs.The boot loader 801 performs reading, writing, and/or erasing by callinginstructions of some predetermined functions. For example, calling theread command “R” can read the data information in the flash memory 800,calling the erase command “E” can erase any one of the memory modulesegments or all the memory module segments, and calling the writecommand “W” can write data to any of the memory module segments or allmemory module segments.

The boot loader 801 stores an executable program in the flash memory 800of the MCU, and is capable of reading data in the flash memory 800 orwriting data to the flash memory. When the application stored in theflash memory 800 needs to be updated, the original application programcan be replaced with the new application program by writing the newapplication program 802 to the application program area by the bootloader 801.

Since the boot loader 801 and the application program are both stored inthe flash memory 800 of the MCU, if the address of the program called bythe MCU is incorrect, the MCU may execute the boot loader 801erroneously. In order to solve this problem, in actual operation, anupgrade key is introduced to start program update.

In the portable power system described above, the power tool 300, thebattery pack 200, and the portable power supply device 100 can allimplement software update and upgrade by applying the boot loader 801.Hereinafter, a method of updating the power tool 300, the battery pack200, and the portable power supply device 100 by the boot loader 801will be described using the portable power system as an example.

Example 1: Program Update by Bus Scheduling

In the bus communication system, the host computer connects the MCUs ofa plurality of modules through the bus, and the host computer as thecommunication device 120 can selectively update the program of any oneor more modules mounted on the bus by using the bus scheduling manner.For convenience of description, each module is referred to as a node502. For example, the first node is called node 1, the second node iscalled node 2, . . . , and the Nth node is called node N.

Referring to FIG. 13, in the upgrade mode, the interaction process ofthe communication device 120 and the node 502 is as follows:

S51: The communication device 120 sends a node upgrade instruction;

S52: The node 502 receives the node upgrade instruction and determineswhether upgrade the node, and if yes, sends an upgrade response(including node identity information) to the communication device 120;if not, stops the original work and enters the listening state (standbystate);

S53: The communication device 120 determines whether the node 502identity information in the upgrade response matches, and if yes, entersan upgrade mode, and sends upgrade information (including an upgradekey);

S54: The node 502 receives the upgrade information, and confirms theupgrade to the communication device 120;

S55: The communication device 120 sends the first upgrade data packet tothe node 502;

S56: After receiving the upgrade data packet, the node 502 verifieswhether the upgrade data packet is correct, and if correct, replies thecorrect information to the communication device 120;

S57: The communication device 120 sends the next upgrade data packet tothe node 502, and proceeds to step S6;

S58: After all the upgrade data packets are completely sent, thecommunication device 120 sends a node upgrade end instruction;

S59: The node 502 receives the node upgrade end instruction, and feedsback the node upgrade end confirmation information.

The operation process of the communication device 120 and the node 502in the upgrade mode will be described in detail with reference to FIGS.14 and 15. Referring to FIG. 14, the operation process of thecommunication device 120 in the upgrade mode is as follows:

S61: Save the upgrade file from an external device (for example, theremote server 20, the mobile terminal device 21);

S62: Upgrade each node in sequence following a preset order;

S63: Send the node N upgrade instruction;

S64: Send the node N upgrade data packet;

S65: Node N upgrade completed and send the node N upgrade endinstruction;

S66: Determine whether all nodes are upgraded, if yes, go to step S67,if not, turn to the next node N (N=N+1), then go to step S63;

S67: Broadcast the overall upgrade end instruction.

During the upgrade process, abnormal situations may occur, causing theupgrade program received by the node 502 to be incomplete, therebyaffecting the normal operation of the node 502. This problem can besolved by setting an upgrade end identifier. Specifically, after thenode upgrade is completed, the node 502 checks if there is an upgradeend identifier in the received upgrade program, and if not, indicatesthat the upgrade program received this time is abnormal (incomplete),then the node enters the forced upgrade mode. In the forced upgrademode, the node enters the active upgrade mode and actively initiates theupgrade request (including the node identity information), and thecommunication device 120 enters the passive upgrade mode to upgrade thecorresponding node.

It should be noted that, in the process of receiving the upgrade programof the external device, the communication device 120 may suffer fromabnormalities such as power failure and network failure, causing theupgrade program received by the communication device 120 to be abnormal,and the upgrade process cannot proceed. To solve this possible problem,it is necessary to keep the latest correct upgrade program in thecommunication device 120 so that the upgrade program can be called tocomplete the node upgrade when an upgrade is required.

The upgrade process of each node is a node upgrade of a closecooperation system, and each node of the bus system needs to enter theupgrade mode and exit the upgrade mode synchronously. Referring to FIG.15, the operation process of each node in the upgrade mode is asfollows:

S71: The bus receives an upgrade instruction from the communicationdevice 120;

S72: All nodes stop working and enter the upgrade listening state(standby state);

S73: Each node detects whether there is an upgrade instruction foritself, if yes, enters an upgrade mode, and if not, stays in thelistening state;

S74: The corresponding node enters the upgrade mode, and replies theupgrade information (including the node identity information, the nodeidentifier, and the like) of the node, and confirms the upgrade;

S75: Receive upgrade information (including an upgrade key) of thecommunication device 120;

S76: Receive upgrade data packets from the communication device 120through the bus, and verify whether the data packet is correct, andreply the correct information;

S77: Upgrade data packets transmission completed, the bus receives anupgrade end instruction, determines whether it is the overall upgradeend instruction, if yes, proceeds to step S78, and if not, proceeds tostep S73;

S78: All upgrades completed, the system is reset, and all nodes arerestored.

After the node 502 is upgraded, the node 502 needs to check the receivedupgrade program. If the received program is found to be abnormal (forexample, the program is incomplete), the node 502 will actively send anupgrade request to perform a forced upgrade. The communication device120 passively responds to the upgrade request of the corresponding node,and upgrades the node 502.

When the communication device upgrades the node that needs to beupgraded through the bus, the data communication format sent to the busincludes the target address of the node to be upgraded, or theidentifier of the node/module to be upgraded.

Referring to FIGS. 16 and 17, a method of performing upgrade by the buswill be illustrated by using the example of the communication device 120upgrading the main control module 132 and the inverter module 131 of theportable power supply device 100.

The upgrade program is stored in the remote server 20. The remote server20 can send the upgrade file directly to the communication device 120 byWIFI, or send or copy the upgrade file to the mobile terminal device 21(iPad, mobile phone, etc.), and then make use of the mobile terminaldevice 21 to transmit the upgrade file to the communication device 120via Bluetooth.

Specifically, the remote server 20 may directly send the upgrade file tothe communication device 120 by means of WIFI to perform a firmwareupgrade process as follows: when the portable power supply device 100requires a firmware upgrade, the remote server 20 sends an upgradeprompt message to the user's mobile phone APP, and the user selects toupgrade. After receiving the upgrade instruction from the user, theremote server 20 sends the upgrade file to the communication device 120by WIFI mode, and the communication device 120 upgrades the firmware ofthe main control module 132 and the inverter module 131 mounted on thebus through the bus scheduling method. The communication device 120sends an upgrade instruction to the main control module 132 and theinverter module 131. Once each module detects that there is an upgradeinstruction on the bus, all the current operations are stopped, andwhether the upgrade instruction is an upgrade instruction to the nativenode is detected. If not, then continue to keep the listening state(standby state), if yes, then enter the upgrade mode. The communicationdevice 120 upgrades the main control module 132 and the inverter module131 in a preset order.

In the upgrade mode, the communication device 120 is connected to thefirst node main control module 132 and the second node inverter module131 via a serial bus. Referring to FIG. 16, the specific wiring methodis as follows: in the normal operation mode, the receiving pin RXD andthe transmitting pin TXD of the serial port of the main control module132 are both in the enabled state, and the serial port of the invertermodule 131 is in the listening state (standby state), that is, thereceiving pin RXD is in the enabled state, and the transmitting pin TXDis in the normal I/O input state; in the upgrade mode, after receivingthe corresponding module upgrade instruction from the bus, thecorresponding module enters an enabled state, that is, both thereceiving pin RXD and the transmitting pin TXD of the serial port of thecorresponding module are in the enabled state, while the other module isin the listening state, and resumes normal operation after the upgradeis completed. The communication device 120 performs firmware upgrade ofthe main control module 132 and the inverter module 131 by the bus in apreset order.

In one example, the communication device 120 performs firmware upgradeon the main control module 132 and inverting module 131 in the order ofmain control module 132 first and then inverting module 131. Referringto FIG. 17, the upgrade process of the IOT to the main control module132 and the inverter module 131 in the upgrade mode will be described.

S91: In the normal operation mode, the serial port of the main controlmodule 132 is in the transceiver enabled state, that is, the receivingpin RXD and the transmitting pin TXD of the serial port of the maincontrol module 132 are both in the enabled state; the serial port of theinverter module 131 is in the listening state, that is, the receivingpin RXD of the inverter module 131 is in the enabled state, and thetransmitting pin TXD is in the normal I/O input state;

S92: The communication device 120 checks whether an upgrade instructionis received, if yes, proceeds to S93, and if not, proceeds to step S91;

S93: The communication device 120 sends an upgrade instruction of themain control module 132 to upgrade the main control module 132 first.

S94: The main control module 132 enters the upgrade mode, the serialport of the main control module 132 is in the transceiver enabled state,and the inverter module 131 is in the listening state;

S95: The upgrade of the main control module 131 is completed; S96: Thecommunication device 120 sends an upgrade instruction of the invertermodule 131 to upgrade the inverter module 131.

S97: The inverter module 131 enters the upgrade mode, and the maincontrol module 132 enters the listening state, and the serial port ofthe inverter module 131 is in the transceiver enabled state;

S98: The upgrade of the inverter module 131 is completed.

S99: The communication device 120 sends the overall upgrade endinstruction, and the upgrade is completed, and the system restoresnormal operation.

The upgrade file is sent to upgrade the main control module 132. Afterthe upgrade of the main control module 132 is completed, thecommunication device 120 sends a node upgrade end instruction thereto,and the main control module 132 feeds back the node upgrade endinstruction. Then, the communication device 120 performs program upgradeon the inverter module 131 of the next node in the same manner. Afterthe upgrade of the inverter module 131 is completed, the communicationdevice 120 sends a node upgrade end instruction thereto, and theinverter module 131 feeds back the node upgrade end instruction. Themain control module 132 broadcasts the overall upgrade end instructionto the bus, and each module detects the overall upgrade end instructionon the bus, and then restores normal operation, and this upgrade is allcompleted.

Example 2: Program Update by Upgrade Device 500

The communication mode between the existing power tool 300 and thebattery pack 200 is single-line communication, and has a correspondingcommunication protocol for discharging management of the battery pack200. The program of the power tool 300 can be updated according to themethod of the above-described update procedure. By mounting the wirelesscommunication module 121 on the communication line, and by apredetermined communication protocol to transmit program information,the program of the battery pack 200 or the tool can be updated andupgraded.

However, the addition of the wireless communication module 121 incurs acertain cost. In order to reduce costs, an upgrade device 500 thatconnects to the tool or battery pack 200 to perform program update ofthe power tool 300 or the battery pack 200 may be designed. The upgradedevice 500 stores the upgrade file of the power tool 300 or the batterypack 200 in advance, and has a communication terminal that communicateswith the communication terminal of the power tool 300 or the batterypack 200. When an upgrade is required, connect the upgrade device 500 tothe power tool 300 or the battery pack 200 through respectivecommunication terminals to establish a communication connection, andtransmit the upgrade file in the upgrade device 500 to the power tool orbattery pack 200 according to a predetermined communication protocol,thereby product updates and upgrades can be realized.

(1) A method to update the program of the power tool 300.

The power tool 300 can be any type of power tool including but notlimited to, electric drills, electric hammers, screwdrivers, impactdrills, electric circular saw jigsaws, reciprocating saws, band saws,electric scissors, sanders, angle grinders, lamps, lasers, nail guns,etc.

Referring to FIG. 18, the power tool 300 has a micro control module 303(hereinafter referred to as “MCU”), and the MCU 303 includes a flashmemory 306 in which the tool application program 308, the tool bootloader 307, and the identity information 309 of the power tool 300 arestored. The flash memory 306 may have a plurality of memory partitionsincluding a partition for storing the application program 308, apartition for storing the boot loader 307, and a partition for storingthe identity information 309 of the power tool 300. The above memorypartitions can be read or erased or rewritten.

The application program 308 runs in the operation mode for controllingthe operation of the power tool 300, such as controlling the rotationalspeed of the motor, controlling the motor to start in a specifiedmanner, and the like. The boot loader 306 runs in the upgrade mode forupdating at least a portion of the application.

For the power tool 300 without the communication device 120 or thewireless communication module 121, a device is required to import thenew application program into the flash memory of the power tool 300 toupdate and/or upgrade the application program 308 in the flash memory306. The device is a dedicated device for upgrading the program of thepower tool 300, hereinafter referred to as an upgrade device 500.

With continued reference to FIG. 18, in one example, the upgrade device500 includes an MCU 501 that includes a storage module 502 for storingdata or programs, a data reading module 503 for reading data, and averification module 504 that verifies information such as whether thepower toll 300 matches the upgrade device 500. The upgrade device 500also includes a display module 505 for human-machine interface display,and the display module 505 can display the remaining time or progress ofthe upgrade. The upgrade device 500 also has an interface module 508 forconnecting to an external storage device 509. The external storagedevice 509 may be a removable memory card, a memory chip or a storagemodule, such as a TF card, a USB flash drive, etc., or may be anotherdevice that can be connected to the upgrade device 500 with or withoutwire, such as a PC or the like. The external storage device 509 storesthe latest application program for updating one or more of the powertools 300. The latest application program may partially or completelyoverwrite the old application program in the power tool 300. The upgradedevice 500 obtains the latest application program for the one or more ofthe power tools 300 stored in the external storage device 509 throughthe interface module 508 and stores it to the storage module 502 toupgrade the software programs of the different power tools 300.

The upgrade device 500 has a communication interface for connection tothe power tool 300. The communication interface is used by themicro-control module of the power tool 300 to establish communicationwith the upgrade device 500 to complete the program update of the powertool 300. The MCU 303 of the power tool 300 can transmit information tothe external device through the communication interface, for example,the MCU 303 of the power tool transmits the identity information of thepower tool 300 to the upgrade device 500 through the communicationinterface. The MCU 303 of the power tool can also receive the signal ofthe upgrade device 500 through the communication interface, and performa response process based on the signal, for example, the MCU 303receives the signal of the upgrade device 500, and decides whether toenter the operation mode or the upgrade mode. The communicationinterface may be a dedicated signal terminal (e.g., a data terminal) ora multiplexed shared terminal (e.g., a temperature signal terminal). Thecommunication interface can be a single terminal or a plurality ofterminals. In order to simplify the program, two terminals may be usedfor communication.

The power tool 300 has two physical interfaces—a first tool terminal 341and a second tool terminal 342, and the upgrade device 500 has an firstupgrade terminal 506 and an second upgrade terminal 507 correspondingthereto, respectively used to connect with the first tool terminal 341and the second tool terminal 342 of the power tool 300.

In the normal operation mode of the power tool 300, that is, when thebattery pack 200 is connected to the power tool 300, the first toolterminal 341 is used to establish communication between the power tool300 and the battery pack 200, and the second tool terminal 342 is usedto transmit the temperature signal of the battery pack 200 or identifythe attribute of the battery pack 200.

In the upgrade mode of the power tool 300, that is, when the upgradedevice 500 is connected to the battery pack 200, the first tool terminal341 is used to identify the upgrade device 500, which keeps the originalcommunication function, the communication protocol, and thecommunication content the same. At this time, the second tool terminal342 is multiplexed, which is used to establish communication between thepower tool 300 and the upgrade device 500, and receive and transmit datainformation during the upgrade process.

Specifically, in one example, the power tool 300 identifies whether theexternal device interfaced with the power tool 300 is the battery pack200 or the upgrade device 500 by identifying whether the voltage of thefirst tool terminal 341 is a high voltage or a low voltage. For example,when the external device is interfaced with the power tool 300 and thevoltage of the first tool terminal 341 is pulled low, the power tool 300recognizes that the external device is the upgrade device 500.

After the power tool 300 recognizes that the external device is theupgrade device 500, it enters the upgrade mode. The MCU 303 of the powertool executes a boot loader 307 to perform a program update process.Since the upgrade device 500 stores one or more of the latest programsfor program update of different power tools 300, it is necessary toselect the corresponding latest program for the specific power tool 300when performing program update. To this end, the identity information309 representing the power tool 300 and/or the upgrade device 500 may bestored in the flash memory 306 of the MCU 303 of the power tool 300 inadvance, and the representative power tool 300 and/or the storage modulein the upgrade device 500 may also be stored. And the identityinformation representing the power tool 300 and/or the upgrade device500 is also stored in the storage module of the upgrade device 500, sothat the power tool 300 and the upgrade device 500 can be matchedcorrectly before the old application program 308 of the power tool 300is rewritten, preventing a wrong program update, which causes the powertool 300 to fail to run correctly after the program is updated. Theupgrade device 500 has a verification module 504, and each power tool300 has a verification module 305. In one example, the verificationmodule 504 of the upgrade device 500 is configured to verify theidentity information of the power tool 300, and the verification moduleof the power tool 300 is used to verify whether the data in the datatransmission is correct, whether the program is complete, as well as theidentity information of the upgrade device 500.

During the program update process, the boot loader 307 needs to write anew program in the upgrade device 500 into the memory partition of theapplication program 308 of the power tool 300. The data packet of thenew application may be large such that cannot be transmitted in onetime. The data packet of the new application may be split into aplurality of small data packets to ease multiple transmissions. Duringthe transmission of the plurality of packets, the sequence of thepackets may be disordered, causing the newly written program to beincorrect. In order to solve this problem, the data packets may benumbered, and at the time of data transmission, the number is verifiedto ensure that the data packets are sequentially written to thecorresponding partitions of the flash memory 306 of the power tool 300in order.

Specifically, the power tool 300 and the upgrade device 500 transmit thedata information involved in the upgrade process by the second upgradeterminal 507 and the second tool terminal 342, the data includingupgrade instructions, upgrade end instructions, feedback replies,upgrade data packets, and the like.

During the upgrade process, the boot loader needs to write the newprogram in the upgrade device to the memory partition of the applicationprogram of the power tool. The data packet of the new applicationprogram (i.e., the upgrade program) may be relatively large such thatcannot be transmitted in one time. Therefore, the data packet of the newapplication needs to be split into multiple small data packets to easemultiple transmissions. During the transmission of the plurality ofpackets, the sequence of the packets may be disordered, causing thenewly written program to be incorrect. In order to solve this problem,the data packets may be numbered, and at the time of data transmission,the number is verified to ensure that the data packets are sequentiallywritten to the corresponding partitions of the flash memory of the powertool in order.

Specifically, the power tool 300 and the upgrade device 500 transmit,through the second terminal, the data packets involved in the upgradeprocess, where the data packets include upgrade instructions, upgradeend instructions, feedback replies, upgrade data packets, deviceidentity information, and the like, and the content of the data packetsincludes the packet header, data length, data type, packet serialnumber, data content, device ID, check digit. Wherein, the data typerefers to whether the data is real-time data or statistical data or anupgrade program, and the packet serial number is the serial number ofeach data packet.

In the operation mode, the power tool 300 executes the applicationprogram 308 in the flash memory 306, whereas the boot loader 307 is alsostored in the flash memory 306. If the address of the program called bythe MCU 303 is incorrect, the MCU 303 may execute the boot loader 307 bymistake, such that the running power tool 300 may work improperly, ormay even bring a security risk. This problem can be solved byintroducing an upgrade key, which is used to instruct the application toupgrade.

Specifically, after the upgrade device 500 confirms that the upgrade ispossible, an upgrade key is sent to the MCU 303 of the power tool 300.After receiving the upgrade key, the MCU 303 confirms that it is anupgrade instruction of the application program, and then executes theboot loader 307 to upgrade the software program of the power tool 300.The MCU 303 of the power tool 300 will only launch the boot loader 307after receiving the upgrade key sent by the upgrade device 500,otherwise the boot loader 307 will not be executed. In this way, it canbe ensured that the boot loader 307 is executed only when a programupdate is required, and is not executed under the operation mode of thepower tool 300 for the safety operation of the power tool 300.

Next, a method of performing program upgrade of the power tool 300 bythe upgrade device 500 will be described with reference to FIG. 19.

First, the upgrade device 500 needs to acquire the latest program storedby the external storage device through the interface module 508 andstore it in its own storage module 502. Then, the user connects theupgrade device 500 to the power tool 300 that needs to be upgraded, thefirst tool terminal 341 establishes a connection with the first upgradeterminal 506, and the second tool terminal 342 establishes a connectionwith the second upgrade terminal 507. The voltage of the first toolterminal 341 is pulled low, the power tool 300 detects that the firsttool terminal 341 is at a low voltage, and the power tool 300 enters theupgrade mode. The upgrade device 500 and the power tool 300 performinformation interaction through the second tool terminal 342 and thesecond upgrade terminal 507. It should be noted that, when the upgradedevice 500 is connected to the power tool 300 to be upgraded, the firstupgrade terminal 506 of the upgrade device 500 is a trigger terminal,and the second upgrade terminal 507 is a data transmission terminal.

It should be noted that, in the operation mode of the power tool 300, itis not appropriate to stop the power tool 300 for program update. Beforethe power tool 300 is powered on, the upgrade device 500 could beconnected thereto to perform the program update of power tool 300.

The following describes the information exchange process of the upgradedevice 500 and the power tool 300 in the upgrade mode:

S111: The power tool 300 detects that the first tool terminal 341 is ofa low voltage signal and enters the upgrade mode.

S112: The power tool 300 returns its identity information to the upgradedevice 500 and prepares for upgrade;

S113: The upgrade device 500 verifies the identity information of thepower tool 300, determines whether to upgrade, and if an upgrade ispossible, sends an upgrade key to the power tool 300;

Specifically, the upgrade device 500 compares the received identityinformation 309 of the power tool 300 with the identity information ofone or more power tools 300 stored in advance in the storage module 502,and confirms whether the storage module 502 stores the received identityinformation 309, if yes, determines that the upgrade device 500 canupgrade the power tool 300, and if not, determines that the upgrade isnot possible.

S114: The power tool 300 obtains the upgrade key, confirms the upgrade,and replies to the upgrade to the upgrade device 500;

S115: After the upgrade device 500 receives the upgrade confirmationsignal of the power tool 300, the upgrade device 500 starts to send thefirst upgrade data packet;

S116: After the power tool 300 receives the data packet, the power tool300 verifies whether the data packet is correct, and if correct, repliesthe correct message to the upgrade device 500;

S117: After the upgrade device 500 receives the correct reply, theupgrade device 500 continues to send the next data packet until the lastdata packet;

S118: The power tool 300 receives the last data packet and repliescorrect;

S119: The upgrade device 500 sends an upgrade end flag to the power tool300;

S120: After the power tool 300 receives the upgrade end flag, the powertool 300 replies that the upgrade is completed.

It should be noted that, in the upgrade mode of the power tool 300,abnormal situations (for example, power failure) may occur, which mayresult in the upgrade program or the upgrade file not being completelywritten into the flash memory 306 of the power tool 300, and theapplication program 308 of the power tool 300 being an incompleteprogram. In the operation mode of the power tool 300, if the incompleteapplication program runs, the power tool 300 may not work properly oreven malfunction, posing a security risk.

In order to solve this problem, you can add flags to the beginning andend of the upgrade program, for example, add the program start flag inthe first upgrade data packet, and add the program end flag in the lastupgrade data packet. If the power tool 300 does not receive the programend flag, then the upgrade program that is written to the power tool 300is considered to be incomplete and the incomplete upgrade program willnot be executed. The application program will only be executed if thereis a program end flag in the application program of the power tool 300.

When the above abnormal situations occur, you need to restart orcontinue to write to the upgrade program. In one example, after theabnormal conditions occur, the upgrade program is rewritten, and thepower tool 300 enters the forced upgrade mode. In the forced upgrademode, once the upgrade device 500 is connected to the power tool 300,the power tool 300 no longer determines whether to enter the upgrademode according to the voltage of the first tool terminal 341, insteadthe power tool 300 actively sends an upgrade request to the upgradedevice 500. In this way, the upgrade program is rewritten.

Of course, in the case where the power tool 300 has the communicationdevice 120, the upgrade file from the external device (for example, amobile phone, a PC, etc.) can be acquired by the communication device.Then, the communication device or other modules are used to update theapplication program in the power tool 300 with alternative method, whichmay be a bus scheduling method or a general communication method toupdate the program of the power tool without upgrading the device 500.

(2) A method to update the program of the battery pack 200.

The method of updating the battery pack 200 program by the upgradedevice 500 is similar to the method of upgrading the power tool 300 bythe upgrade device 500.

The upgrade device 500 for program update of the battery pack 200 andthe upgrade device 500 for program update of the power tool 300 maycontain the same components, except that the upgrade programs stored inthe two storage modules 502 are different, respectively the upgradeprogram for the battery pack 200 and the upgrade program for the powertool 300.

It should be noted that the power tool 300 updates the program in thenon-operation mode after power-on, whereas the battery pack 200 mayupdate the program at any time. The condition for the battery pack 200to enter the upgrade mode may be to detect whether the voltage of thefirst battery pack terminal 231 indicates the upgrade device 500, or thebattery pack 200 may directly send an upgrade request to the upgradedevice 500 to enter the upgrade mode.

Specifically, when an external device such as the charger or the upgradedevice 500 or the power tool 300 is connected to the battery pack 200,after the battery pack 200 is powered on, firstly, the battery packconfirms which device is used according to the external device feedbacksignal, and when the battery pack 200 confirms it to be the upgradedevice 500, the battery pack 200 sends its own identity information tothe upgrade device 500, and prepares for upgrade.

Referring to FIG. 20, the battery pack 200 has two physical terminals, afirst battery pack terminal 231 and a second battery pack terminal 232.The upgrade device 500 has a first upgrade terminal 506 and a secondupgrade terminal 507 corresponding thereto, respectively connected tothe first battery pack terminal 231 and the second battery pack terminal232.

In the method in which the battery pack 200 sends its own identityinformation 209 to the upgrade device 500 to request to enter theupgrade mode, it is necessary to set an upgrade flag in the battery pack200 in advance. The upgrade identifier can be written to the flashmemory 206 or other storage module of the MCU of the battery pack 200 byan external device using a wireless or wired manner. When the upgradedevice 500 is connected to the battery pack 200, if the battery pack 200is detected to store the upgrade identifier, the upgrade key is sent tothe battery pack 200, and the MCU 203 of the battery pack 200 executesthe boot loader 207, writes the upgrade program in the storage module502 of the upgrade device 500 to the memory partition of the applicationprogram of the battery pack 200, and update the application program ofthe battery pack 200, otherwise the program update process is notlaunched. Once the upgrade program is executed, regardless of whetherthe upgrade was successful or not, the upgrade ID is cleared to preventthe boot loader from being executed multiple times.

Referring to FIG. 21, the information exchange process of the upgradedevice 500 and the battery pack 200 in the upgrade mode is as follows:

S131: The upgrade device 500 sends its own identity information to thebattery pack 200;

S132: The battery pack 200 receives the identity information of theupgrade device 500, replies its own identity information to the upgradedevice 500 and prepares for the upgrade;

S133: The upgrade device 500 verifies the identity information of thebattery pack 200, determines whether to perform the upgrade, and if theupgrade is possible, sends the upgrade key to the battery pack 200;

The upgrade device 500 determines whether to upgrade. Specifically, itis necessary to determine the following: First, whether the identityinformation of the battery pack 200 is in line with the upgrade device500. The upgrade device 500 compares the received identity informationof the battery pack 200 to the identity information 209 of one or morebattery packs 200 stored in the storage module 502 in advance todetermine whether the received identity information is stored in thestorage module 502. If so, the program update can be performed on thebattery pack 200; if not, the program update cannot be performed.Second, whether there is an upgrade flag in the storage module of thebattery pack 200. If so, the program update can be performed on thebattery pack 200; if not, the program update cannot be performed.

S134: The battery pack 200 receives the upgrade key, confirms theupgrade, and replies the upgrade confirmation to the upgrade device 500;

S135: After receiving the upgrade confirmation information of thebattery pack 200, the upgrade device 500 starts to send the firstupgrade data packet;

S136: After receiving the data packet, the battery pack 200 checkswhether the data packet is correct (whether the data packet sequence iscorrect, whether the data packet content is correct, etc.), if correct,replies the correct message to the upgrade device 500;

S137: After receiving the correct reply, the upgrade device 500continues to send the next data packet until the last data packet;

S138: The battery pack 200 receives the last data packet and replies thecorrect message;

S139: The upgrade device 500 sends an upgrade end flag to the batterypack 200;

S140: After the battery pack 200 receives the upgrade end flag, theupgrade is completed.

In the above data transmission processes, it is necessary to considerthe possibility of data transmission timeout, and a timeoutretransmission mechanism is introduced for this purpose. During thenormal transmission process, the master 600 sends an instruction or datato the slave 700, and the slave 700 receives the instruction or data andfeeds back to the master 600 to ensure that the transmission is normal(refer to FIG. 22). In the timeout transmission, the master 600 sends aninstruction or data to the slave 700, the slave 700 does not feed backto the master 600 within a specified time, or the master 600 does notreceive feedback from the slave 700 within a specified time. To ensurethat the data can be transmitted effectively, perform the timeoutretransmission as follows:

S151: After the master 600 sends an instruction or data to the slave700, the timer starts;

S152: The master 600 determines whether the slave 700 replies within aspecified time. If yes, send the next instruction or data to the slave700, and go to step S151; if not, the instruction or data transmissionis considered to be unsuccessful;

S153: The master 600 sends the same instruction or data to the slave 700again;

S154: The master 600 determines whether the predetermined upper limit ofthe number of retransmissions is reached. If yes, it is considered thatthe transmission has failed, and go to step S156; if not, go to stepS152;

S156: Terminate the transmission process.

In the above program update processes, the master 600 may be thecommunication device 120 or the upgrade tool, and the slave 700 may bethe main control module 132, the inverter module 131, the power tool300, or the battery pack 200. It should be noted that the upper limit ofthe number of retransmissions is set according to the specificconditions or requirements, for example, 3, 5, 10 times, etc., in orderto save energy. After the transmission fails, the display module of theupgrade device 500 displays an alarm state to remind the user that theupgrade has failed.

The basic principles, main features and advantages of the presentdisclosure have been shown and described above. It should be understoodby those skilled in the art that the above-described examples are notintended to limit the disclosure in any way, and the technical solutionsobtained by means of equivalent replacement or equivalent transformationare all within the scope of the disclosure.

INDUSTRIAL APPLICABILITY

The present disclosure provides an electrical device along with aprogram update method of the electrical device that makes program updateconvenient, fast, safe and reliable.

What claimed is:
 1. An electrical device, comprising: a housing; at least one adapter interface formed on a surface of the housing to detachably mount one or more battery packs to the at least one adapter interface, wherein the battery pack is operable to supply power to a hand-held, power tool or a garden tool; and a control module that programmably controls an operation process of the electrical device; wherein the electrical device further comprises a communication module, and the communication module comprises: a wireless communication module to wirelessly communicate with an external device to receive an upgrade file from the external device; and a storage module to store the upgrade file from an external device, the upgrade file comprises an upgrade program for updating a program of the control module; wherein the communication module is configured to receive the upgrade file from an external device through the wireless communication module, store the upgrade file in the storage module, and send the upgrade file to the control module to update the program of the control module in preset condition; and wherein the electrical device is a portable power supply device, the portable power supply device further comprises an inverter module, the inverter module comprises an inverter for converting a direct current outputted by the battery pack into alternating current, and the inverter module is electrically connected to the control module and is at least partially under the control of the control module.
 2. The electrical device of claim 1, wherein the electrical device further comprises a data bus, the control module and the inverter module are connected to the communication module via the data bus, the communication module is configured to receive the upgrade file of the external device through the wireless communication module, store the upgrade file in the storage module, and transmit the upgrade file to the control module and/or the inverter module through the data bus, and the upgrade file comprises an upgrade program that updates the program of the control module and/or the inverter module.
 3. The electrical device of claim 2, wherein the control module and the inverter module have unique identifiers.
 4. The electrical device of claim 3, wherein the upgrade file comprises a unique identifier of the control module and/or the inverter module.
 5. A program update method compatible with an electrical device, comprising: receiving, by a communication module, an upgrade file from an external device through a wireless communication module and storing the upgrade file in a storage module; sending, by the communication module, an upgrade instruction to a data bus when preset conditions are met; terminating work and entering a listening state, by a control module and an inverter module, after receiving the upgrade instruction from the data bus; determining, by the control module and the inverter module, whether the upgrade instruction is an upgrade instruction to itself, and if yes, entering an upgrade mode, and if not, maintaining the listening state; sending, by one of the control module and the inverter module who determines that the upgrade instruction is an upgrade instruction to itself, the upgrade instruction to the data bus; sending, by the communication module, the upgrade file through the data bus to the control module or the inverter module who sends an upgrade response after receiving the upgrade response from the data bus; and updating, by the control module or the inverter module, its own program according to the upgrade file after receiving the upgrade file.
 6. The program update method of claim 5, wherein, when the communication module receives an upgrade request from the control module or the inverter module, the communication module sends an upgrade instruction to the data bus.
 7. The program update method of claim 6, wherein the upgrade file has a program end flag, and the control module or the inverter module sends the upgrade request to the communication module when the program end flag is not received.
 8. The program update method of claim 5, wherein the communication module transmits an upgrade instruction to the data bus when the communication module receives an upgrade request from an external device.
 9. The program update method of claim 5, wherein the control module and the inverter module have unique identifiers, the upgrade instruction comprises the unique identifier of the control module and/or the inverter module, and the control module and the inverter module determine whether the unique identifier in the upgrade instruction matches its own unique identifier, and if so, determine that it is an upgrade instruction for itself.
 10. The program update method of claim 5, wherein the control module and the inverter module have unique identifiers, and the upgrade response comprises the unique identifier.
 11. The program update method of claim 10, wherein the program update method further comprises, after receiving the upgrade response, the communication module sends an upgrade key to the control module or the inverter module that matches the unique identifier in the upgrade response and the control module or the inverter module that matches the unique identifier receives the upgrade the key enters a program update process.
 12. The program update method of claim 5, wherein the communication module transmits the upgrade file to the control module and the inverter module in a preset order.
 13. The program update method of claim 12, wherein the program update method further comprises, after the program update of itself is completed, the control module or the inverter module sends an upgrade end feedback to the communication module and, when the communication module does not receive the upgrade end feedback from the control module and the inverter module, the communication module sends an upgrade instruction to the data bus. 